From 5e119eed42bc044c41a36e5451eb0213a5607005 Mon Sep 17 00:00:00 2001 From: Daniel Caires Date: Wed, 10 Jul 2024 07:55:14 -0300 Subject: [PATCH] Add new label to fm-rest-api pods Add the label 'app.starlingx.io/component' to all fm-rest-api pods. The value of the label can only be 'platform' or 'application', if the value is different from that, the label will not be applied. The value of 'app.starlingx.io/component' will be set by the label 'isApplication' in the values file, 'true' for 'application' and 'false' for 'platform'. By default, all pods start with the value 'platform'. Test Plan: PASS - The Helm charts are successfully built PASS - The pods are deployed with label value set to platform PASS - The pods are restarted if the value changes Story: 2010612 Task: 50517 Change-Id: Ib8c5826c6f5630c1180b3765ba6037150a8ae705 Signed-off-by: Daniel Caires --- .../helm-charts/fm-rest-api/templates/deployment.yaml | 3 +++ fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml index c591009..5ef2c68 100755 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/templates/deployment.yaml @@ -33,7 +33,10 @@ spec: template: metadata: labels: + app.starlingx.io/component: {{ ternary "application" "platform" .Values.labels.isApplication }} {{ tuple $envAll "fm" "fmapi" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + annotations: + configchecksum: {{ toYaml .Values.labels.isApplication | sha256sum | trunc 63 }} spec: serviceAccountName: {{ $serviceAccountName }} initContainers: diff --git a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml index 39e31f2..e546bf2 100644 --- a/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml +++ b/fm-rest-api/fm-rest-api/helm-charts/fm-rest-api/values.yaml @@ -7,6 +7,7 @@ # Declare variables to be passed into your templates. labels: + isApplication: false fm_api: node_selector_key: openstack-control-plane node_selector_value: enabled