From d5fbcea2f6adb3b8389e77fad146f088af78b00f Mon Sep 17 00:00:00 2001 From: Thomas Decaux Date: Tue, 26 Nov 2024 17:14:57 +0100 Subject: [PATCH 1/2] feat(helm): add pod annotation with config checksum So the replicaSet (deployment, daemonset etc...) is automatically restarted after config changes. --- operations/helm/charts/alloy/templates/controllers/_pod.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/operations/helm/charts/alloy/templates/controllers/_pod.yaml b/operations/helm/charts/alloy/templates/controllers/_pod.yaml index ce5677b301..8d5cf98338 100644 --- a/operations/helm/charts/alloy/templates/controllers/_pod.yaml +++ b/operations/helm/charts/alloy/templates/controllers/_pod.yaml @@ -3,6 +3,9 @@ metadata: annotations: kubectl.kubernetes.io/default-container: alloy + {{- if $values.configMap.create }} + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- end }} {{- with .Values.controller.podAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} From 3d350aa63a391ca3bc7c3f93be8ba3984123fac9 Mon Sep 17 00:00:00 2001 From: Thomas Decaux Date: Wed, 27 Nov 2024 09:00:38 +0100 Subject: [PATCH 2/2] Test if reloader is disabled --- operations/helm/charts/alloy/templates/controllers/_pod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/helm/charts/alloy/templates/controllers/_pod.yaml b/operations/helm/charts/alloy/templates/controllers/_pod.yaml index 8d5cf98338..edc0e4f2d3 100644 --- a/operations/helm/charts/alloy/templates/controllers/_pod.yaml +++ b/operations/helm/charts/alloy/templates/controllers/_pod.yaml @@ -3,7 +3,7 @@ metadata: annotations: kubectl.kubernetes.io/default-container: alloy - {{- if $values.configMap.create }} + {{- if and (not .Values.configReloader.enabled) $values.configMap.create }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- end }} {{- with .Values.controller.podAnnotations }}