From 460d1343082fbb3999504d6d801b27b465056aeb Mon Sep 17 00:00:00 2001 From: "jeremy.hulick" Date: Wed, 11 Dec 2024 12:12:47 -0700 Subject: [PATCH] update optional pod labels for use of version, via verbosePodLabels.enabled in values --- charts/fluent-bit/templates/_helpers.tpl | 4 ++-- charts/fluent-bit/templates/daemonset.yaml | 6 +++++- charts/fluent-bit/templates/deployment.yaml | 6 +++++- charts/fluent-bit/values.yaml | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/charts/fluent-bit/templates/_helpers.tpl b/charts/fluent-bit/templates/_helpers.tpl index f46f88d2..1e1b867e 100644 --- a/charts/fluent-bit/templates/_helpers.tpl +++ b/charts/fluent-bit/templates/_helpers.tpl @@ -52,9 +52,9 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} {{/* -Pod labels +Verbose Pod labels */}} -{{- define "fluent-bit.podLabels" -}} +{{- define "fluent-bit.verbosePodLabels" -}} {{ include "fluent-bit.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} diff --git a/charts/fluent-bit/templates/daemonset.yaml b/charts/fluent-bit/templates/daemonset.yaml index 49feedcf..752b8399 100644 --- a/charts/fluent-bit/templates/daemonset.yaml +++ b/charts/fluent-bit/templates/daemonset.yaml @@ -27,7 +27,11 @@ spec: template: metadata: labels: - {{- include "fluent-bit.podLabels" . | nindent 8 }} + {{- if .Values.verbosePodLabels.enabled }} + {{- include "fluent-bit.verbosePodLabels" . | nindent 8 }} + {{- else }} + {{- include "fluent-bit.selectorLabels" . | nindent 8 }} + {{- end }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/fluent-bit/templates/deployment.yaml b/charts/fluent-bit/templates/deployment.yaml index ab092975..990a5d7b 100644 --- a/charts/fluent-bit/templates/deployment.yaml +++ b/charts/fluent-bit/templates/deployment.yaml @@ -30,7 +30,11 @@ spec: template: metadata: labels: - {{- include "fluent-bit.podLabels" . | nindent 8 }} + {{- if .Values.verbosePodLabels.enabled }} + {{- include "fluent-bit.verbosePodLabels" . | nindent 8 }} + {{- else }} + {{- include "fluent-bit.selectorLabels" . | nindent 8 }} + {{- end }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/fluent-bit/values.yaml b/charts/fluent-bit/values.yaml index df4e47f1..99a8fea0 100644 --- a/charts/fluent-bit/values.yaml +++ b/charts/fluent-bit/values.yaml @@ -302,6 +302,10 @@ podAnnotations: {} podLabels: {} +# adds app.kubernetes.io/version label to pods for istio required labels +verbosePodLabels: + enabled: false + ## How long (in seconds) a pods needs to be stable before progressing the deployment ## minReadySeconds: