From dafc841e223c0f01092a2e116888a3304142e1b8 Mon Sep 17 00:00:00 2001 From: Minh Vuong <38932626+vuongxuongminh@users.noreply.github.com> Date: Thu, 24 Feb 2022 02:58:03 +0700 Subject: [PATCH] feat: allow adding pod labels (#18848) --- helm/superset/Chart.yaml | 2 +- helm/superset/templates/deployment-beat.yaml | 3 +++ helm/superset/templates/deployment-worker.yaml | 3 +++ helm/superset/templates/deployment.yaml | 3 +++ helm/superset/values.schema.json | 9 +++++++++ helm/superset/values.yaml | 9 ++++++--- 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 189ffcdb3..ab74a648e 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -22,7 +22,7 @@ maintainers: - name: craig-rueda email: craig@craigrueda.com url: https://github.com/craig-rueda -version: 0.5.9 +version: 0.5.10 dependencies: - name: postgresql version: 10.2.0 diff --git a/helm/superset/templates/deployment-beat.yaml b/helm/superset/templates/deployment-beat.yaml index c014959c2..55223defc 100644 --- a/helm/superset/templates/deployment-beat.yaml +++ b/helm/superset/templates/deployment-beat.yaml @@ -55,6 +55,9 @@ spec: labels: app: {{ template "superset.name" . }}-celerybeat release: {{ .Release.Name }} + {{- if .Values.supersetCeleryBeat.podLabels }} + {{ toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }} + {{- end }} spec: securityContext: runAsUser: {{ .Values.runAsUser }} diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml index 8a86349cb..07bacd371 100644 --- a/helm/superset/templates/deployment-worker.yaml +++ b/helm/superset/templates/deployment-worker.yaml @@ -53,6 +53,9 @@ spec: labels: app: {{ template "superset.name" . }}-worker release: {{ .Release.Name }} + {{- if .Values.supersetWorker.podLabels }} + {{ toYaml .Values.supersetWorker.podLabels | nindent 8 }} + {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} serviceAccountName: {{ template "superset.serviceAccountName" . }} diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index 10de683b3..b760d5454 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -56,6 +56,9 @@ spec: labels: app: {{ template "superset.name" . }} release: {{ .Release.Name }} + {{- if .Values.supersetNode.podLabels }} + {{ toYaml .Values.supersetNode.podLabels | nindent 8 }} + {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} serviceAccountName: {{ template "superset.serviceAccountName" . }} diff --git a/helm/superset/values.schema.json b/helm/superset/values.schema.json index 2abe2b4b7..2273718d7 100644 --- a/helm/superset/values.schema.json +++ b/helm/superset/values.schema.json @@ -272,6 +272,9 @@ }, "podAnnotations": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/annotations" + }, + "podLabels": { + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels" } }, "required": [ @@ -299,6 +302,9 @@ }, "podAnnotations": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/annotations" + }, + "podLabels": { + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels" } }, "required": [ @@ -327,6 +333,9 @@ }, "podAnnotations": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/annotations" + }, + "podLabels": { + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/labels" } }, "required": [ diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 392af0cbe..1c23b056b 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -248,7 +248,8 @@ supersetNode: deploymentAnnotations: {} ## Annotations to be added to supersetNode pods podAnnotations: {} - + ## Labels to be added to supersetNode pods + podLabels: {} ## ## Superset worker configuration supersetWorker: @@ -269,7 +270,8 @@ supersetWorker: deploymentAnnotations: {} ## Annotations to be added to supersetWorker pods podAnnotations: {} - + ## Labels to be added to supersetWorker pods + podLabels: {} ## ## Superset beat configuration (to trigger scheduled jobs like reports) supersetCeleryBeat: @@ -292,7 +294,8 @@ supersetCeleryBeat: deploymentAnnotations: {} ## Annotations to be added to supersetCeleryBeat pods podAnnotations: {} - + ## Labels to be added to supersetCeleryBeat pods + podLabels: {} ## ## Init job configuration init: