From 2d99900b57109710b177bf978e6640a92a04b9f1 Mon Sep 17 00:00:00 2001 From: "jeremy.hulick" Date: Mon, 9 Dec 2024 12:58:01 -0700 Subject: [PATCH 1/4] add kubernetes version label to pods Signed-off-by: jeremy.hulick --- charts/fluent-bit/templates/_helpers.tpl | 10 ++++++++++ charts/fluent-bit/templates/daemonset.yaml | 2 +- charts/fluent-bit/templates/deployment.yaml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/charts/fluent-bit/templates/_helpers.tpl b/charts/fluent-bit/templates/_helpers.tpl index 84a30563..f46f88d2 100644 --- a/charts/fluent-bit/templates/_helpers.tpl +++ b/charts/fluent-bit/templates/_helpers.tpl @@ -51,6 +51,16 @@ app.kubernetes.io/name: {{ include "fluent-bit.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} +{{/* +Pod labels +*/}} +{{- define "fluent-bit.podLabels" -}} +{{ include "fluent-bit.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +{{- end -}} + {{/* Create the name of the service account to use */}} diff --git a/charts/fluent-bit/templates/daemonset.yaml b/charts/fluent-bit/templates/daemonset.yaml index 12570954..49feedcf 100644 --- a/charts/fluent-bit/templates/daemonset.yaml +++ b/charts/fluent-bit/templates/daemonset.yaml @@ -27,7 +27,7 @@ spec: template: metadata: labels: - {{- include "fluent-bit.selectorLabels" . | nindent 8 }} + {{- include "fluent-bit.podLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/fluent-bit/templates/deployment.yaml b/charts/fluent-bit/templates/deployment.yaml index 7ba61b5f..ab092975 100644 --- a/charts/fluent-bit/templates/deployment.yaml +++ b/charts/fluent-bit/templates/deployment.yaml @@ -30,7 +30,7 @@ spec: template: metadata: labels: - {{- include "fluent-bit.selectorLabels" . | nindent 8 }} + {{- include "fluent-bit.podLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} From 5d4dfe2c4c2f9a53ac52c42c03f49c396096e400 Mon Sep 17 00:00:00 2001 From: "jeremy.hulick" Date: Mon, 9 Dec 2024 13:03:14 -0700 Subject: [PATCH 2/4] bump semver for kubernetes version label Signed-off-by: jeremy.hulick --- charts/fluent-bit/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/fluent-bit/Chart.yaml b/charts/fluent-bit/Chart.yaml index f97e1a12..378e4afe 100644 --- a/charts/fluent-bit/Chart.yaml +++ b/charts/fluent-bit/Chart.yaml @@ -5,7 +5,7 @@ keywords: - logging - fluent-bit - fluentd -version: 0.48.3 +version: 0.48.4 appVersion: 3.2.2 icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/fluentd/fluentbit/icon/fluentbit-icon-color.svg home: https://fluentbit.io/ From 41f787b9168990e92c8fb90e23249fdc152f2a04 Mon Sep 17 00:00:00 2001 From: "jeremy.hulick" Date: Wed, 11 Dec 2024 12:12:47 -0700 Subject: [PATCH 3/4] update optional pod labels for use of version, via verbosePodLabels.enabled in values Signed-off-by: jeremy.hulick --- 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: From dc8b8bdebe7855e1d9d2f3102bd641140311c437 Mon Sep 17 00:00:00 2001 From: "jeremy.hulick" Date: Thu, 12 Dec 2024 11:36:47 -0700 Subject: [PATCH 4/4] changes per peer review comments Signed-off-by: jeremy.hulick --- charts/fluent-bit/templates/daemonset.yaml | 6 +----- charts/fluent-bit/templates/deployment.yaml | 6 +----- charts/fluent-bit/values.yaml | 3 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/charts/fluent-bit/templates/daemonset.yaml b/charts/fluent-bit/templates/daemonset.yaml index 752b8399..3c9b08fa 100644 --- a/charts/fluent-bit/templates/daemonset.yaml +++ b/charts/fluent-bit/templates/daemonset.yaml @@ -27,11 +27,7 @@ spec: template: metadata: labels: - {{- if .Values.verbosePodLabels.enabled }} - {{- include "fluent-bit.verbosePodLabels" . | nindent 8 }} - {{- else }} - {{- include "fluent-bit.selectorLabels" . | nindent 8 }} - {{- end }} + {{- include (ternary "fluent-bit.verbosePodLabels" "fluent-bit.selectorLabels" .Values.verbosePodLabels) . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/fluent-bit/templates/deployment.yaml b/charts/fluent-bit/templates/deployment.yaml index 990a5d7b..7327060b 100644 --- a/charts/fluent-bit/templates/deployment.yaml +++ b/charts/fluent-bit/templates/deployment.yaml @@ -30,11 +30,7 @@ spec: template: metadata: labels: - {{- if .Values.verbosePodLabels.enabled }} - {{- include "fluent-bit.verbosePodLabels" . | nindent 8 }} - {{- else }} - {{- include "fluent-bit.selectorLabels" . | nindent 8 }} - {{- end }} + {{- include (ternary "fluent-bit.verbosePodLabels" "fluent-bit.selectorLabels" .Values.verbosePodLabels) . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/fluent-bit/values.yaml b/charts/fluent-bit/values.yaml index 99a8fea0..9c77c265 100644 --- a/charts/fluent-bit/values.yaml +++ b/charts/fluent-bit/values.yaml @@ -303,8 +303,7 @@ podAnnotations: {} podLabels: {} # adds app.kubernetes.io/version label to pods for istio required labels -verbosePodLabels: - enabled: false +verbosePodLabels: false ## How long (in seconds) a pods needs to be stable before progressing the deployment ##