From c47acda66edb61d50be0d18127c880f8a7f8cc00 Mon Sep 17 00:00:00 2001 From: Eli Mayost Date: Wed, 8 Apr 2026 15:12:04 +0200 Subject: [PATCH 1/6] Add checksum support for external ConfigMap usage --- charts/fluentd/templates/_helpers.tpl | 13 ++++++++++++- charts/fluentd/templates/daemonset.yaml | 5 ++++- charts/fluentd/values.yaml | 4 ++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/charts/fluentd/templates/_helpers.tpl b/charts/fluentd/templates/_helpers.tpl index 1b1bf702..c3c5fe50 100644 --- a/charts/fluentd/templates/_helpers.tpl +++ b/charts/fluentd/templates/_helpers.tpl @@ -91,6 +91,17 @@ Name of the configMap used for additional configuration files; allows users to o {{- end -}} {{- end -}} +{{/* +Compute checksum for config to trigger pod restart. +*/}} +{{- define "fluentd.configChecksum" -}} +{{- if .Values.extraFilesConfigMapNameOverride -}} + {{- default "" .Values.extraFilesConfigMapChecksum -}} +{{- else -}} + {{- include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum -}} +{{- end -}} +{{- end -}} + {{/* HPA ApiVersion according k8s version Check legacy first so helm template / kustomize will default to latest version @@ -101,4 +112,4 @@ autoscaling/v2beta2 {{- else -}} autoscaling/v2 {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/fluentd/templates/daemonset.yaml b/charts/fluentd/templates/daemonset.yaml index 1fb6f761..ef227ab5 100644 --- a/charts/fluentd/templates/daemonset.yaml +++ b/charts/fluentd/templates/daemonset.yaml @@ -26,7 +26,10 @@ spec: template: metadata: annotations: - checksum/config: {{ include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum }} + {{- $checksum := include "fluentd.configChecksum" . -}} + {{- if $checksum }} + checksum/config: {{ $checksum }} + {{- end }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/fluentd/values.yaml b/charts/fluentd/values.yaml index ac05f8b2..45f90066 100644 --- a/charts/fluentd/values.yaml +++ b/charts/fluentd/values.yaml @@ -181,6 +181,10 @@ initContainers: [] ## NOTE: This will replace ALL default files in the aforementioned path! # extraFilesConfigMapNameOverride: "" +## Checksum of externally managed extra configMap files. +## When set, this value is used to trigger pod restarts on config changes. +# extraFilesConfigMapChecksum: "" + mountVarLogDirectory: true mountDockerContainersDirectory: true From 5d823beadcacc925f8407c06062f6647dd944cbd Mon Sep 17 00:00:00 2001 From: elimayost Date: Mon, 13 Apr 2026 15:38:15 +0200 Subject: [PATCH 2/6] Remove fluentd.configChecksum helper function Removed the fluentd.configChecksum helper function to simplify the template. Signed-off-by: elimayost --- charts/fluentd/templates/_helpers.tpl | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/charts/fluentd/templates/_helpers.tpl b/charts/fluentd/templates/_helpers.tpl index c3c5fe50..91a3bdf2 100644 --- a/charts/fluentd/templates/_helpers.tpl +++ b/charts/fluentd/templates/_helpers.tpl @@ -91,17 +91,6 @@ Name of the configMap used for additional configuration files; allows users to o {{- end -}} {{- end -}} -{{/* -Compute checksum for config to trigger pod restart. -*/}} -{{- define "fluentd.configChecksum" -}} -{{- if .Values.extraFilesConfigMapNameOverride -}} - {{- default "" .Values.extraFilesConfigMapChecksum -}} -{{- else -}} - {{- include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum -}} -{{- end -}} -{{- end -}} - {{/* HPA ApiVersion according k8s version Check legacy first so helm template / kustomize will default to latest version From 88caa76e3b747a0ad9e16d69f1f77f94cd782027 Mon Sep 17 00:00:00 2001 From: elimayost Date: Mon, 13 Apr 2026 15:41:11 +0200 Subject: [PATCH 3/6] Update checksum annotation for fluentd daemonset Signed-off-by: elimayost --- charts/fluentd/templates/daemonset.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/charts/fluentd/templates/daemonset.yaml b/charts/fluentd/templates/daemonset.yaml index ef227ab5..a17bdd68 100644 --- a/charts/fluentd/templates/daemonset.yaml +++ b/charts/fluentd/templates/daemonset.yaml @@ -26,12 +26,9 @@ spec: template: metadata: annotations: - {{- $checksum := include "fluentd.configChecksum" . -}} - {{- if $checksum }} - checksum/config: {{ $checksum }} - {{- end }} - {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + checksum/config: {{ include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum }} + {{- range $k, $v := .Values.podAnnotations }} + {{ $k }}: {{ tpl ($v | toString) $ | quote }} {{- end }} labels: {{- include "fluentd.selectorLabels" . | nindent 8 }} From 8ca0f2ec59a0f5f11c8ba4af9d4757da46de8ddb Mon Sep 17 00:00:00 2001 From: elimayost Date: Mon, 13 Apr 2026 15:42:02 +0200 Subject: [PATCH 4/6] Remove extraFilesConfigMapChecksum from values.yaml Removed checksum configuration for externally managed configMap files. Signed-off-by: elimayost --- charts/fluentd/values.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/charts/fluentd/values.yaml b/charts/fluentd/values.yaml index 45f90066..ac05f8b2 100644 --- a/charts/fluentd/values.yaml +++ b/charts/fluentd/values.yaml @@ -181,10 +181,6 @@ initContainers: [] ## NOTE: This will replace ALL default files in the aforementioned path! # extraFilesConfigMapNameOverride: "" -## Checksum of externally managed extra configMap files. -## When set, this value is used to trigger pod restarts on config changes. -# extraFilesConfigMapChecksum: "" - mountVarLogDirectory: true mountDockerContainersDirectory: true From ab3abfe9bfeca3d574444878b71e4ff41d9d21cb Mon Sep 17 00:00:00 2001 From: elimayost Date: Mon, 13 Apr 2026 15:43:18 +0200 Subject: [PATCH 5/6] Fix missing newline at end of _helpers.tpl Signed-off-by: elimayost From 751f8ba24a8f3c8ad42178abe0995f556f1df02f Mon Sep 17 00:00:00 2001 From: elimayost Date: Mon, 13 Apr 2026 15:45:12 +0200 Subject: [PATCH 6/6] Fix indentation in _helpers.tpl Signed-off-by: elimayost