From 82a35a0a883f4a0d4f004af08b8b83c0cc5075d1 Mon Sep 17 00:00:00 2001 From: Erickson Silva de Oliveira Date: Tue, 13 Feb 2024 09:35:43 -0300 Subject: [PATCH 2/2] Add label platform/application to pods Add support to 'app.starlingx.io/component' to be overwritten by user override, with possible values being 'platform' and 'application'. With 'platform' being the default value. This change will also restart the pods if the label in namespace change. Signed-off-by: Erickson Silva de Oliveira Signed-off-by: David Barbosa Bastos --- templates/deployment.yaml | 2 ++ values.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 48cda7fe..77c1938f 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -24,12 +24,14 @@ spec: template: metadata: labels: + app.starlingx.io/component: {{ ternary "application" "platform" .Values.isApplicationLabel}} {{- include "metrics-server.selectorLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.podAnnotations }} annotations: + configchecksum: {{ toYaml .Values.isApplicationLabel | sha256sum | trunc 63 }} {{- toYaml . | nindent 8 }} {{- end }} spec: diff --git a/values.yaml b/values.yaml index 54567451..2182c37f 100644 --- a/values.yaml +++ b/values.yaml @@ -45,6 +45,7 @@ apiService: # The PEM encoded CA bundle for TLS verification caBundle: "" +isApplicationLabel: false commonLabels: {} podLabels: {} podAnnotations: {} -- 2.34.1