diff --git a/agent-chart/templates/_helpers.tpl b/agent-chart/templates/_helpers.tpl index f018995f..7fbc0ac3 100644 --- a/agent-chart/templates/_helpers.tpl +++ b/agent-chart/templates/_helpers.tpl @@ -46,7 +46,10 @@ Selector labels app.kubernetes.io/name: {{ include "incident-commander.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} control-plane: incident-commander -{{- if .Values.global.labels }} +{{- end }} + +{{- define "incident-commander.extraLabels" -}} +{{- if .Values.global.labels -}} {{.Values.global.labels | toYaml}} {{- end }} {{- end }} diff --git a/agent-chart/templates/deployment.yaml b/agent-chart/templates/deployment.yaml index 9428fc3b..80750ebf 100644 --- a/agent-chart/templates/deployment.yaml +++ b/agent-chart/templates/deployment.yaml @@ -4,6 +4,7 @@ metadata: name: {{ include "incident-commander.name" . }} labels: {{- include "incident-commander.labels" . | nindent 4 }} + {{- include "incident-commander.extraLabels" . | nindent 4 }} spec: replicas: {{ .Values.replicas }} selector: @@ -13,6 +14,7 @@ spec: metadata: labels: {{- include "incident-commander.selectorLabels" . | nindent 8 }} + {{- include "incident-commander.extraLabels" . | nindent 8 }} spec: serviceAccountName: {{ .Values.serviceAccount.name }} volumes: diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index f018995f..7fbc0ac3 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -46,7 +46,10 @@ Selector labels app.kubernetes.io/name: {{ include "incident-commander.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} control-plane: incident-commander -{{- if .Values.global.labels }} +{{- end }} + +{{- define "incident-commander.extraLabels" -}} +{{- if .Values.global.labels -}} {{.Values.global.labels | toYaml}} {{- end }} {{- end }} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 325fd8ac..0379ab26 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -4,6 +4,7 @@ metadata: name: {{ include "incident-commander.name" . }} labels: {{- include "incident-commander.labels" . | nindent 4 }} + {{- include "incident-commander.extraLabels" . | nindent 4 }} spec: replicas: {{ .Values.replicas }} revisionHistoryLimit: 1 @@ -14,6 +15,7 @@ spec: metadata: labels: {{- include "incident-commander.selectorLabels" . | nindent 8 }} + {{- include "incident-commander.extraLabels" . | nindent 8 }} spec: serviceAccountName: {{ .Values.serviceAccount.name }} volumes: