Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #314 from pbecotte/ExtraMounts
Browse files Browse the repository at this point in the history
Had to add a couple extra mounts to get MetricBeat to pick up all the…
  • Loading branch information
jmlrt authored Nov 21, 2019
2 parents 0411010 + c28567f commit 7e74e7c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
16 changes: 14 additions & 2 deletions metricbeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions metricbeat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -115,5 +115,5 @@ spec:
subPath: {{ $path }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{ tpl .Values.extraVolumeMounts . | indent 8 }}
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
{{- end }}
5 changes: 2 additions & 3 deletions metricbeat/tests/metricbeat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

Expand Down

0 comments on commit 7e74e7c

Please sign in to comment.