From 0ae53e415c2415b1777b0cae75bc8d068aaf0eba Mon Sep 17 00:00:00 2001 From: Gustaf Lindstedt Date: Tue, 30 Aug 2022 14:22:32 +0200 Subject: [PATCH] Add `app.kubernetes.io/version` label to chart Add `app.kubernetes.io/version` label as described in https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ This is useful if you have many deployments in different clusters and want to be able to monitor what versions you have deployed using something like `kube_pod_labels` from kube-state-metrics. Signed-off-by: Gustaf Lindstedt --- charts/flagger/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/flagger/templates/deployment.yaml b/charts/flagger/templates/deployment.yaml index 4301c453f..badb6197b 100644 --- a/charts/flagger/templates/deployment.yaml +++ b/charts/flagger/templates/deployment.yaml @@ -7,6 +7,7 @@ metadata: app.kubernetes.io/name: {{ template "flagger.name" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} spec: replicas: {{ .Values.leaderElection.replicaCount }} {{- if eq .Values.leaderElection.enabled false }} @@ -22,6 +23,7 @@ spec: labels: app.kubernetes.io/name: {{ template "flagger.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} {{- if .Values.podLabels }} {{- range $key, $value := .Values.podLabels }} {{ $key }}: {{ $value | quote }}