From 8fd06d9d6c74a7257858eb270d0d81fe7048989f Mon Sep 17 00:00:00 2001 From: Christian Groschupp Date: Mon, 4 Apr 2022 11:46:15 +0200 Subject: [PATCH 1/2] change default value of filebeat.extraContainers --- filebeat/README.md | 4 ++-- filebeat/values.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/filebeat/README.md b/filebeat/README.md index 06678822b..7de65ac92 100644 --- a/filebeat/README.md +++ b/filebeat/README.md @@ -130,8 +130,8 @@ as a reference. They are also used in the automated testing of this chart. | `deployment.securityContext` | Configurable [securityContext][] for filebeat Deployment pod execution environment | see [values.yaml][] | | `deployment.tolerations` | Configurable [tolerations][] for filebeat Deployment | `[]` | | `replicas` | The replica count for the Filebeat deployment | `1` | -| `extraContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` | -| `extraInitContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` | +| `extraContainers` | Templatable string of additional containers to be passed to the `tpl` function | `[]` | +| `extraInitContainers` | Templatable string of additional containers to be passed to the `tpl` function | `[]` | | `fullnameOverride` | Overrides the full name of the resources. If not set the name will default to " `.Release.Name` - `.Values.nameOverride or .Chart.Name` " | `""` | | `hostPathRoot` | Fully-qualified [hostPath][] that will be used to persist filebeat registry data | `/var/lib` | | `imagePullPolicy` | The Kubernetes [imagePullPolicy][] value | `IfNotPresent` | diff --git a/filebeat/values.yaml b/filebeat/values.yaml index c3c6a66ca..a63bd354e 100644 --- a/filebeat/values.yaml +++ b/filebeat/values.yaml @@ -156,7 +156,7 @@ deployment: # Replicas being used for the filebeat deployment replicas: 1 -extraContainers: "" +extraContainers: [] # - name: dummy-init # image: busybox # command: ['echo', 'hey'] From 3c31d9a41ec0b7cb2b3bb2e1abbbb47eb7251880 Mon Sep 17 00:00:00 2001 From: Christian Groschupp Date: Mon, 4 Apr 2022 11:52:50 +0200 Subject: [PATCH 2/2] add backwards compatibility for extraContainers --- filebeat/templates/daemonset.yaml | 7 +++++++ filebeat/templates/deployment.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/filebeat/templates/daemonset.yaml b/filebeat/templates/daemonset.yaml index 54bfa70b0..3c889f347 100644 --- a/filebeat/templates/daemonset.yaml +++ b/filebeat/templates/daemonset.yaml @@ -196,6 +196,13 @@ spec: {{ toYaml (.Values.extraVolumeMounts | default .Values.daemonset.extraVolumeMounts ) | indent 8 }} {{- end }} {{- if .Values.extraContainers }} + # Currently some extra blocks accept strings + # to continue with backwards compatibility this is being kept + # whilst also allowing for yaml to be specified too. + {{- if eq "string" (printf "%T" .Values.extraContainers) }} {{ tpl .Values.extraContainers . | indent 6 }} + {{- else }} +{{ toYaml .Values.extraContainers | indent 6 }} + {{- end }} {{- end }} {{- end }} diff --git a/filebeat/templates/deployment.yaml b/filebeat/templates/deployment.yaml index a8fd82649..aedd738b4 100644 --- a/filebeat/templates/deployment.yaml +++ b/filebeat/templates/deployment.yaml @@ -152,6 +152,13 @@ spec: {{ toYaml ( .Values.extraVolumeMounts | default .Values.deployment.extraVolumeMounts ) | indent 8 }} {{- end }} {{- if .Values.extraContainers }} + # Currently some extra blocks accept strings + # to continue with backwards compatibility this is being kept + # whilst also allowing for yaml to be specified too. + {{- if eq "string" (printf "%T" .Values.extraContainers) }} {{ tpl .Values.extraContainers . | indent 6 }} + {{- else }} +{{ toYaml .Values.extraContainers | indent 6 }} + {{- end }} {{- end }} {{- end }}