From 04605dcd77135fa21c46c3e7bca6b3c9b2f64b69 Mon Sep 17 00:00:00 2001 From: Paul Becotte Date: Sat, 12 Oct 2019 12:39:00 -0400 Subject: [PATCH] use a list for extra volume mounts to match the comments and other values --- .gitignore | 1 + filebeat/README.md | 4 ++-- filebeat/templates/daemonset.yaml | 4 ++-- filebeat/tests/filebeat_test.py | 4 ++-- filebeat/values.yaml | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b88248453..beeb2f712 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ elastic-certificates.p12 *.pyc index.yaml *.tgz +.idea/ diff --git a/filebeat/README.md b/filebeat/README.md index d8b57c9bd..1565e29cc 100644 --- a/filebeat/README.md +++ b/filebeat/README.md @@ -46,8 +46,8 @@ helm install --name filebeat elastic/filebeat --set imageTag=7.4.0 | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | `filebeatConfig` | Allows you to add any config files in `/usr/share/filebeat` such as `filebeat.yml`. See [values.yaml](./values.yaml) for an example of the formatting with the default configuration. | see [values.yaml](./values.yaml) | | `extraEnvs` | Extra [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config) which will be appended to the `env:` definition for the container | `[]` | -| `extraVolumeMounts` | Templatable string of additional volumeMounts to be passed to the `tpl` function | `""` | -| `extraVolumes` | Templatable string of additional volumes to be passed to the `tpl` function | `""` | +| `extraVolumeMounts` | List of additional volumeMounts to be mounted on the Daemonset | `""` | +| `extraVolumes` | List of additional volumes to be mounted on the Daemonset | `""` | | `hostPathRoot` | Fully-qualified [hostPath](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath) that will be used to persist Filebeat registry data | `/var/lib` | | `image` | The Filebeat docker image | `docker.elastic.co/beats/filebeat` | | `imageTag` | The Filebeat docker image tag | `7.4.0` | diff --git a/filebeat/templates/daemonset.yaml b/filebeat/templates/daemonset.yaml index ff0b9bc8b..ace9e7a3f 100644 --- a/filebeat/templates/daemonset.yaml +++ b/filebeat/templates/daemonset.yaml @@ -72,7 +72,7 @@ spec: hostPath: path: /var/run/docker.sock {{- if .Values.extraVolumes }} -{{ tpl .Values.extraVolumes . | indent 6 }} +{{ toYaml .Values.extraVolumes | indent 6 }} {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: @@ -143,5 +143,5 @@ spec: mountPath: /var/run/docker.sock readOnly: true {{- if .Values.extraVolumeMounts }} -{{ tpl .Values.extraVolumeMounts . | indent 8 }} +{{ toYaml .Values.extraVolumeMounts | indent 8 }} {{- end }} diff --git a/filebeat/tests/filebeat_test.py b/filebeat/tests/filebeat_test.py index 5bd288921..9a21a8415 100644 --- a/filebeat/tests/filebeat_test.py +++ b/filebeat/tests/filebeat_test.py @@ -167,10 +167,10 @@ def test_adding_a_secret_mount(): def test_adding_a_extra_volume_with_volume_mount(): config = ''' -extraVolumes: | +extraVolumes: - name: extras emptyDir: {} -extraVolumeMounts: | +extraVolumeMounts: - name: extras mountPath: /usr/share/extras readOnly: true diff --git a/filebeat/values.yaml b/filebeat/values.yaml index 1e6af7585..983f10e80 100755 --- a/filebeat/values.yaml +++ b/filebeat/values.yaml @@ -21,12 +21,12 @@ extraEnvs: [] # - name: MY_ENVIRONMENT_VAR # value: the_value_goes_here -extraVolumeMounts: "" +extraVolumeMounts: [] # - name: extras # mountPath: /usr/share/extras # readOnly: true -extraVolumes: "" +extraVolumes: [] # - name: extras # emptyDir: {}