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/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 }} 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']