From 49175ce5b5bd3e96fcd9193f26efdd0192f70f0e Mon Sep 17 00:00:00 2001 From: mfordjody <11638005@qq.comm> Date: Mon, 15 Jan 2024 19:16:00 +0800 Subject: [PATCH] Zipkin charts adding namespaces Change chart version --- charts/zipkin/Chart.yaml | 2 +- charts/zipkin/templates/_helpers.tpl | 7 +++++++ charts/zipkin/templates/deployment.yaml | 1 + charts/zipkin/templates/hpa.yaml | 1 + charts/zipkin/templates/ingress.yaml | 1 + charts/zipkin/templates/psp.yaml | 1 + charts/zipkin/templates/role.yaml | 1 + charts/zipkin/templates/rolebinding.yaml | 1 + charts/zipkin/templates/service.yaml | 1 + charts/zipkin/templates/serviceaccount.yaml | 1 + charts/zipkin/values.yaml | 1 + 11 files changed, 17 insertions(+), 1 deletion(-) diff --git a/charts/zipkin/Chart.yaml b/charts/zipkin/Chart.yaml index 5121ede..6d1aeb9 100644 --- a/charts/zipkin/Chart.yaml +++ b/charts/zipkin/Chart.yaml @@ -14,7 +14,7 @@ appVersion: 3.0.2 name: zipkin description: A Zipkin helm chart for kubernetes type: application -version: 0.1.1 +version: 0.1.2 maintainers: - name: openzipkin email: zipkin-dev@googlegroups.com diff --git a/charts/zipkin/templates/_helpers.tpl b/charts/zipkin/templates/_helpers.tpl index 52d4cee..c949954 100644 --- a/charts/zipkin/templates/_helpers.tpl +++ b/charts/zipkin/templates/_helpers.tpl @@ -44,6 +44,13 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Create chart namespaces. +*/}} +{{- define "zipkin.namespace" -}} +{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + {{/* Common labels */}} diff --git a/charts/zipkin/templates/deployment.yaml b/charts/zipkin/templates/deployment.yaml index 94f2c2f..4c7279a 100644 --- a/charts/zipkin/templates/deployment.yaml +++ b/charts/zipkin/templates/deployment.yaml @@ -15,6 +15,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "zipkin.fullname" . }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} spec: diff --git a/charts/zipkin/templates/hpa.yaml b/charts/zipkin/templates/hpa.yaml index 68ec038..ab89efe 100644 --- a/charts/zipkin/templates/hpa.yaml +++ b/charts/zipkin/templates/hpa.yaml @@ -16,6 +16,7 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "zipkin.fullname" . }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} spec: diff --git a/charts/zipkin/templates/ingress.yaml b/charts/zipkin/templates/ingress.yaml index c815344..387f354 100644 --- a/charts/zipkin/templates/ingress.yaml +++ b/charts/zipkin/templates/ingress.yaml @@ -24,6 +24,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} diff --git a/charts/zipkin/templates/psp.yaml b/charts/zipkin/templates/psp.yaml index 46b2e4d..35b2d2d 100644 --- a/charts/zipkin/templates/psp.yaml +++ b/charts/zipkin/templates/psp.yaml @@ -19,6 +19,7 @@ metadata: labels: {{- include "zipkin.labels" . | nindent 4 }} name: {{ include "zipkin.fullname" . }} + namespace: {{ include "zipkin.namespace" . }} annotations: seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' diff --git a/charts/zipkin/templates/role.yaml b/charts/zipkin/templates/role.yaml index 3406b40..9299e23 100644 --- a/charts/zipkin/templates/role.yaml +++ b/charts/zipkin/templates/role.yaml @@ -16,6 +16,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ include "zipkin.fullname" . }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} rules: diff --git a/charts/zipkin/templates/rolebinding.yaml b/charts/zipkin/templates/rolebinding.yaml index f7c1cff..0b39073 100644 --- a/charts/zipkin/templates/rolebinding.yaml +++ b/charts/zipkin/templates/rolebinding.yaml @@ -16,6 +16,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "zipkin.serviceAccountName" . }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} roleRef: diff --git a/charts/zipkin/templates/service.yaml b/charts/zipkin/templates/service.yaml index e6858fb..64958ce 100644 --- a/charts/zipkin/templates/service.yaml +++ b/charts/zipkin/templates/service.yaml @@ -15,6 +15,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "zipkin.fullname" . }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} spec: diff --git a/charts/zipkin/templates/serviceaccount.yaml b/charts/zipkin/templates/serviceaccount.yaml index 1889946..969b370 100644 --- a/charts/zipkin/templates/serviceaccount.yaml +++ b/charts/zipkin/templates/serviceaccount.yaml @@ -16,6 +16,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "zipkin.serviceAccountName" . }} + namespace: {{ include "zipkin.namespace" . }} labels: {{- include "zipkin.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} diff --git a/charts/zipkin/values.yaml b/charts/zipkin/values.yaml index 8beadba..4c2166e 100644 --- a/charts/zipkin/values.yaml +++ b/charts/zipkin/values.yaml @@ -21,6 +21,7 @@ image: imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +namespaceOverride: "" serviceAccount: # Specifies whether a service account should be created