diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index d75310e0..6c2c48a0 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -36,8 +36,10 @@ Selector labels app.kubernetes.io/name: {{ include "config-db.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} control-plane: {{ include "config-db.name" . }} -{{- if .Values.global.labels }} +{{- end }} + +{{- define "config-db.extraLabels" -}} +{{- if .Values.global.labels -}} {{.Values.global.labels | toYaml}} {{- end }} {{- end }} - diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 0f7cde87..37352512 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -8,7 +8,9 @@ kind: Deployment {{- end }} metadata: name: {{ include "config-db.name" . }} - labels: {{- include "config-db.labels" . | nindent 4 }} + labels: + {{- include "config-db.labels" . | nindent 4 }} + {{- include "config-db.extraLabels" . | nindent 4 }} spec: replicas: {{ .Values.replicas }} revisionHistoryLimit: 1 @@ -32,7 +34,9 @@ spec: {{- end }} template: metadata: - labels: {{- include "config-db.selectorLabels" . | nindent 8 }} + labels: + {{- include "config-db.selectorLabels" . | nindent 8 }} + {{- include "config-db.extraLabels" . | nindent 8 }} spec: serviceAccountName: {{ template "config-db.serviceAccountName" . }} securityContext: