diff --git a/metricbeat/templates/daemonset.yaml b/metricbeat/templates/daemonset.yaml index 237b9d0d7..4e8286382 100644 --- a/metricbeat/templates/daemonset.yaml +++ b/metricbeat/templates/daemonset.yaml @@ -68,8 +68,14 @@ spec: - name: varrundockersock hostPath: path: /var/run/docker.sock + - name: proc + hostPath: + path: /proc + - name: cgroup + hostPath: + path: /sys/fs/cgroup {{- if .Values.extraVolumes }} -{{ tpl .Values.extraVolumes . | indent 6 }} +{{ toYaml .Values.extraVolumes | indent 6 }} {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: @@ -143,6 +149,12 @@ spec: - name: varrundockersock mountPath: /var/run/docker.sock readOnly: true + - name: proc + mountPath: /hostfs/proc + readOnly: true + - name: cgroup + mountPath: /hostfs/sys/fs/cgroup + readOnly: true {{- if .Values.extraVolumeMounts }} -{{ tpl .Values.extraVolumeMounts . | indent 8 }} +{{ toYaml .Values.extraVolumeMounts | indent 8 }} {{- end }} diff --git a/metricbeat/templates/deployment.yaml b/metricbeat/templates/deployment.yaml index 96cce2ea6..13d29d873 100644 --- a/metricbeat/templates/deployment.yaml +++ b/metricbeat/templates/deployment.yaml @@ -51,7 +51,7 @@ spec: name: {{ template "fullname" . }}-config {{- end }} {{- if .Values.extraVolumes }} -{{ tpl .Values.extraVolumes . | indent 6 }} +{{ toYaml .Values.extraVolumes | indent 6 }} {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: @@ -115,5 +115,5 @@ spec: subPath: {{ $path }} {{- end }} {{- if .Values.extraVolumeMounts }} -{{ tpl .Values.extraVolumeMounts . | indent 8 }} +{{ toYaml .Values.extraVolumeMounts | indent 8 }} {{- end }} diff --git a/metricbeat/tests/metricbeat_test.py b/metricbeat/tests/metricbeat_test.py index 84dc55f23..f5fd7443e 100644 --- a/metricbeat/tests/metricbeat_test.py +++ b/metricbeat/tests/metricbeat_test.py @@ -2,7 +2,6 @@ import sys sys.path.insert(1, os.path.join(sys.path[0], '../../helpers')) from helpers import helm_template -import yaml project = 'metricbeat' name = 'release-name-' + project @@ -166,10 +165,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/metricbeat/values.yaml b/metricbeat/values.yaml index fea0deafd..7640ddec8 100755 --- a/metricbeat/values.yaml +++ b/metricbeat/values.yaml @@ -73,12 +73,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: {}