From 185a3b86e92f02e1803f5f3a8465f2619ac6181a Mon Sep 17 00:00:00 2001 From: Thomas Hartland Date: Wed, 23 Oct 2024 13:56:39 +0100 Subject: [PATCH] Add extraContainers to fluentd chart Copy the templating and the examples in the values file from the fluent-bit chart. Signed-off-by: Thomas Hartland --- charts/fluentd/templates/_pod.tpl | 7 +++++++ charts/fluentd/values.yaml | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/charts/fluentd/templates/_pod.tpl b/charts/fluentd/templates/_pod.tpl index e285e3a8..2ebb49af 100644 --- a/charts/fluentd/templates/_pod.tpl +++ b/charts/fluentd/templates/_pod.tpl @@ -87,6 +87,13 @@ containers: - mountPath: /var/log/fluent name: {{ include "fluentd.fullname" . }}-buffer {{- end }} +{{- if .Values.extraContainers }} + {{- if kindIs "string" .Values.extraContainers }} + {{- tpl .Values.extraContainers $ | nindent 2 }} + {{- else }} + {{- toYaml .Values.extraContainers | nindent 2 }} + {{- end -}} +{{- end }} volumes: - name: etcfluentd-main configMap: diff --git a/charts/fluentd/values.yaml b/charts/fluentd/values.yaml index ac05f8b2..2a8a1d60 100644 --- a/charts/fluentd/values.yaml +++ b/charts/fluentd/values.yaml @@ -174,6 +174,21 @@ envFrom: [] initContainers: [] +# This supports either a structured array or a templatable string +extraContainers: [] + +# Array mode +# extraContainers: +# - name: do-something +# image: busybox +# command: ['do', 'something'] + +# String mode +# extraContainers: |- +# - name: do-something +# image: bitnami/kubectl:{{ .Capabilities.KubeVersion.Major }}.{{ .Capabilities.KubeVersion.Minor }} +# command: ['kubectl', 'version'] + ## Name of the configMap containing a custom fluentd.conf configuration file to use instead of the default. # mainConfigMapNameOverride: ""