From 2d9c7d141046510febf43ba73834392da19b45a2 Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Mon, 13 Sep 2021 17:47:33 +0200 Subject: [PATCH] Update: additional labels Signed-off-by: Nicolas Lamirault --- charts/argo-cd/templates/_helpers.tpl | 4 ++++ charts/argo-cd/templates/redis/deployment.yaml | 2 -- charts/argo-cd/values.yaml | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index 9ab07ef4..1dc2f2c7 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -125,6 +125,10 @@ helm.sh/chart: {{ include "argo-cd.chart" .context }} {{ include "argo-cd.selectorLabels" (dict "context" .context "component" .component "name" .name) }} app.kubernetes.io/managed-by: {{ .context.Release.Service }} app.kubernetes.io/part-of: argocd +app.kubernetes.io/version: {{ .context.Chart.AppVersion | quote }} +{{- if .context.Values.global.additionalLabels }} +{{ toYaml .context.Values.global.additionalLabels }} +{{- end }} {{- end }} {{/* diff --git a/charts/argo-cd/templates/redis/deployment.yaml b/charts/argo-cd/templates/redis/deployment.yaml index f3dd7f05..808c72a2 100755 --- a/charts/argo-cd/templates/redis/deployment.yaml +++ b/charts/argo-cd/templates/redis/deployment.yaml @@ -6,7 +6,6 @@ metadata: name: {{ template "argo-cd.redis.fullname" . }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }} - app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }} spec: selector: matchLabels: @@ -21,7 +20,6 @@ spec: {{- end }} labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 8 }} - app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }} {{- if .Values.redis.podLabels }} {{- toYaml .Values.redis.podLabels | nindent 8 }} {{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index dc04e3eb..5ea8ea16 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -21,6 +21,9 @@ global: # - ip: 10.20.30.40 # hostnames: # - git.myhostname + # Additional labels to add to all resources + additionalLabels: {} + # app: argo-cd ## Controller controller: