From a841390c0188d178fdcf3fde3e6842dc690850e6 Mon Sep 17 00:00:00 2001 From: Nicole Date: Mon, 5 Feb 2024 18:04:56 -0700 Subject: [PATCH] [prometheus-node-exporter] Add MountPropagation and VolumeMount Type to Daemonset (#4201) * added params for mount type and mount propagation Signed-off-by: Nicole * added some doc links to volume mount type Signed-off-by: Nicole * added with statement for mount type so it does not have to be set Signed-off-by: Nicole * added with statement to make type optional and not be set Signed-off-by: Nicole * update version Signed-off-by: Nicole * disable sysfsmount Signed-off-by: Nicole * moved type from volumemounts to volumes Signed-off-by: Nicole * spacing changes, deindentation changes Signed-off-by: Nicole --------- Signed-off-by: Nicole --- charts/prometheus-node-exporter/Chart.yaml | 2 +- .../templates/daemonset.yaml | 9 +++++++++ charts/prometheus-node-exporter/values.yaml | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-node-exporter/Chart.yaml b/charts/prometheus-node-exporter/Chart.yaml index 923276db45fe..7abe42bbcf85 100644 --- a/charts/prometheus-node-exporter/Chart.yaml +++ b/charts/prometheus-node-exporter/Chart.yaml @@ -6,7 +6,7 @@ keywords: - prometheus - exporter type: application -version: 4.27.0 +version: 4.28.0 appVersion: 1.7.0 home: https://github.com/prometheus/node_exporter/ sources: diff --git a/charts/prometheus-node-exporter/templates/daemonset.yaml b/charts/prometheus-node-exporter/templates/daemonset.yaml index 23996a7da3f3..77b578d562d4 100644 --- a/charts/prometheus-node-exporter/templates/daemonset.yaml +++ b/charts/prometheus-node-exporter/templates/daemonset.yaml @@ -136,9 +136,15 @@ spec: volumeMounts: - name: proc mountPath: /host/proc + {{- with .Values.hostProcFsMount.mountPropagation }} + mountPropagation: {{ . }} + {{- end }} readOnly: true - name: sys mountPath: /host/sys + {{- with .Values.hostSysFsMount.mountPropagation }} + mountPropagation: {{ . }} + {{- end }} readOnly: true {{- if .Values.hostRootFsMount.enabled }} - name: root @@ -267,6 +273,9 @@ spec: - name: {{ $mount.name }} hostPath: path: {{ $mount.hostPath }} + {{- with $mount.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 9b94ab0547d7..6b81b6c8aaf4 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -317,6 +317,16 @@ hostRootFsMount: # https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation mountPropagation: HostToContainer +# Mount the node's proc file system (/proc) at /host/proc in the container +hostProcFsMount: + # Possible values are None, HostToContainer, and Bidirectional + mountPropagation: "" + +# Mount the node's sys file system (/sys) at /host/sys in the container +hostSysFsMount: + # Possible values are None, HostToContainer, and Bidirectional + mountPropagation: "" + ## Assign a group of affinity scheduling rules ## affinity: {} @@ -392,6 +402,8 @@ 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