Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion charts/fluentd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -101,4 +112,4 @@ autoscaling/v2beta2
{{- else -}}
autoscaling/v2
{{- end -}}
{{- end -}}
{{- end -}}
5 changes: 4 additions & 1 deletion charts/fluentd/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/fluentd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down