metrics-server-armada-app/metrics-server-helm/files/0002-Add-label-platform-app...

50 lines
1.5 KiB
Diff

From acb714d1a5b52b7246f616858fa2ee5e44f51289 Mon Sep 17 00:00:00 2001
From: dbarbosa <david.barbosabastos@windriver.com>
Date: Wed, 13 Dec 2023 18:39:15 -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.
---
templates/deployment.yaml | 2 ++
values.yaml | 1 +
2 files changed, 3 insertions(+)
diff --git a/templates/deployment.yaml b/templates/deployment.yaml
index 1d656fc..097c55f 100644
--- a/templates/deployment.yaml
+++ b/templates/deployment.yaml
@@ -21,12 +21,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 b31a5fb..e6992c9 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