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 <DanielMarques.Caires@windriver.com>
This commit is contained in:
Daniel Caires 2024-07-10 07:55:14 -03:00
parent fc7d8a611c
commit 5e119eed42
2 changed files with 4 additions and 0 deletions

View File

@ -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:

View File

@ -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