diff --git a/charts/prometheus-node-exporter/templates/daemonset.yaml b/charts/prometheus-node-exporter/templates/daemonset.yaml index aeaeae892e45..ac137d2b86f9 100644 --- a/charts/prometheus-node-exporter/templates/daemonset.yaml +++ b/charts/prometheus-node-exporter/templates/daemonset.yaml @@ -136,14 +136,14 @@ spec: volumeMounts: - name: proc mountPath: /host/proc - {{- if .Values.hostProcFsMount.enabled }} - mountPropagation: {{ .Values.hostProcFsMount.mountPropagation }} + {{- with .Values.hostProcFsMount.mountPropagation }} + mountPropagation: {{ . }} {{- end }} readOnly: true - name: sys mountPath: /host/sys - {{- if .Values.hostSysFsMount.enabled }} - mountPropagation: {{ .Values.hostSysFsMount.mountPropagation }} + {{- with .Values.hostSysFsMount.mountPropagation }} + mountPropagation: {{ . }} {{- end }} readOnly: true {{- if .Values.hostRootFsMount.enabled }} @@ -161,9 +161,6 @@ spec: {{- with $mount.mountPropagation }} mountPropagation: {{ . }} {{- end }} - {{- with $mount.type }} - type: {{ . }} - {{- end }} {{- end }} {{- range $_, $mount := .Values.sidecarVolumeMount }} - name: {{ $mount.name }} @@ -276,6 +273,9 @@ spec: - name: {{ $mount.name }} hostPath: path: {{ $mount.hostPath }} + {{- with $mount.hostPath.type }} + type: {{ . }} + {{- end }} {{- end }} {{- range $_, $mount := .Values.sidecarVolumeMount }} - name: {{ $mount.name }} diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index 3488c1bc908f..880952878f6a 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -319,15 +319,13 @@ hostRootFsMount: # Mount the node's proc file system (/) at /host/proc in the container hostProcFsMount: - enabled: false # Possible values are None, HostToContainer, and Bidirectional - mountPropagation: HostToContainer + mountPropagation: "" # Mount the node's sys file system (/) at /host/sys in the container hostSysFsMount: - enabled: false # Possible values are None, HostToContainer, and Bidirectional - mountPropagation: HostToContainer + mountPropagation: "" ## Assign a group of affinity scheduling rules ## @@ -404,11 +402,11 @@ extraArgs: [] extraHostVolumeMounts: [] # - name: # hostPath: +# https://kubernetes.io/docs/concepts/storage/volumes/#hostpath-volume-types +# type: "" (Default)|DirectoryOrCreate|Directory|FileOrCreate|File|Socket|CharDevice|BlockDevice # mountPath: # readOnly: true|false # mountPropagation: None|HostToContainer|Bidirectional -# https://kubernetes.io/docs/concepts/storage/volumes/#hostpath-volume-types -# type: "" (Default)|DirectoryOrCreate|Directory|FileOrCreate|File|Socket|CharDevice|BlockDevice ## Additional configmaps to be mounted.