From 7396a11a842fa65f61ec6c5b5bdafe91e61a036d Mon Sep 17 00:00:00 2001 From: Nicole Date: Tue, 30 Jan 2024 08:52:34 -0700 Subject: [PATCH 1/8] added params for mount type and mount propagation Signed-off-by: Nicole --- .../prometheus-node-exporter/templates/daemonset.yaml | 7 +++++++ charts/prometheus-node-exporter/values.yaml | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/charts/prometheus-node-exporter/templates/daemonset.yaml b/charts/prometheus-node-exporter/templates/daemonset.yaml index 23996a7da3f3..60626accc9e2 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 + {{- if .Values.hostProcFsMount.enabled }} + mountPropagation: {{ .Values.hostProcFsMount.mountPropagation }} + {{- end }} readOnly: true - name: sys mountPath: /host/sys + {{- if .Values.hostSysFsMount.enabled }} + mountPropagation: {{ .Values.hostSysFsMount.mountPropagation }} + {{- end }} readOnly: true {{- if .Values.hostRootFsMount.enabled }} - name: root @@ -155,6 +161,7 @@ spec: {{- with $mount.mountPropagation }} mountPropagation: {{ . }} {{- end }} + type: {{ $mount.type}} {{- 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..ad3fd7e95225 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 (/) at /host/proc in the container +hostProcFsMount: + enabled: false + mountPropagation: HostToContainer + +# Mount the node's sys file system (/) at /host/sys in the container +hostSysFsMount: + enabled: true + mountPropagation: HostToContainer + ## Assign a group of affinity scheduling rules ## affinity: {} @@ -394,6 +404,7 @@ extraHostVolumeMounts: [] # hostPath: # mountPath: # readOnly: true|false +# type: "" (Default)|DirectoryOrCreate|Directory|FileOrCreate|File|Socket|CharDevice|BlockDevice # mountPropagation: None|HostToContainer|Bidirectional ## Additional configmaps to be mounted. From 2227e4200327d77894ad126df92964fede4fe198 Mon Sep 17 00:00:00 2001 From: Nicole Date: Wed, 31 Jan 2024 10:17:17 -0700 Subject: [PATCH 2/8] added some doc links to volume mount type Signed-off-by: Nicole --- charts/prometheus-node-exporter/values.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index ad3fd7e95225..7cbaddf0c623 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -320,11 +320,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 # Mount the node's sys file system (/) at /host/sys in the container hostSysFsMount: enabled: true + # Possible values are None, HostToContainer, and Bidirectional mountPropagation: HostToContainer ## Assign a group of affinity scheduling rules @@ -404,6 +406,7 @@ extraHostVolumeMounts: [] # hostPath: # mountPath: # readOnly: true|false +# https://kubernetes.io/docs/concepts/storage/volumes/#hostpath-volume-types # type: "" (Default)|DirectoryOrCreate|Directory|FileOrCreate|File|Socket|CharDevice|BlockDevice # mountPropagation: None|HostToContainer|Bidirectional From 72215ac78c22d4d51975e9e4c5142bfa5710ac7e Mon Sep 17 00:00:00 2001 From: Nicole Date: Wed, 31 Jan 2024 10:24:31 -0700 Subject: [PATCH 3/8] added with statement for mount type so it does not have to be set Signed-off-by: Nicole --- charts/prometheus-node-exporter/templates/daemonset.yaml | 4 +++- charts/prometheus-node-exporter/values.yaml | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/prometheus-node-exporter/templates/daemonset.yaml b/charts/prometheus-node-exporter/templates/daemonset.yaml index 60626accc9e2..aeaeae892e45 100644 --- a/charts/prometheus-node-exporter/templates/daemonset.yaml +++ b/charts/prometheus-node-exporter/templates/daemonset.yaml @@ -161,7 +161,9 @@ spec: {{- with $mount.mountPropagation }} mountPropagation: {{ . }} {{- end }} - type: {{ $mount.type}} + {{- 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 7cbaddf0c623..d6a182303b6f 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -401,14 +401,15 @@ extraArgs: [] ## Additional mounts from the host to node-exporter container ## -extraHostVolumeMounts: [] +#extraHostVolumeMounts: [] # - name: # hostPath: # 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 -# mountPropagation: None|HostToContainer|Bidirectional + ## Additional configmaps to be mounted. ## From e21cfbaa596dff71699d2e905f8c75b8e4f3ec13 Mon Sep 17 00:00:00 2001 From: Nicole Date: Wed, 31 Jan 2024 10:35:32 -0700 Subject: [PATCH 4/8] added with statement to make type optional and not be set Signed-off-by: Nicole --- charts/prometheus-node-exporter/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index d6a182303b6f..c2e21fc5c8be 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -401,7 +401,7 @@ extraArgs: [] ## Additional mounts from the host to node-exporter container ## -#extraHostVolumeMounts: [] +extraHostVolumeMounts: [] # - name: # hostPath: # mountPath: From b6257bc7a3944ba3b802fbb4be03fac8e5553c52 Mon Sep 17 00:00:00 2001 From: Nicole Date: Thu, 1 Feb 2024 08:09:50 -0700 Subject: [PATCH 5/8] update version Signed-off-by: Nicole --- charts/prometheus-node-exporter/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 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: From e854f9962b53a71192c7f3e333076b58dce74345 Mon Sep 17 00:00:00 2001 From: Nicole Date: Thu, 1 Feb 2024 08:12:16 -0700 Subject: [PATCH 6/8] disable sysfsmount Signed-off-by: Nicole --- charts/prometheus-node-exporter/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index c2e21fc5c8be..3488c1bc908f 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -325,7 +325,7 @@ hostProcFsMount: # Mount the node's sys file system (/) at /host/sys in the container hostSysFsMount: - enabled: true + enabled: false # Possible values are None, HostToContainer, and Bidirectional mountPropagation: HostToContainer From 202ea37e3cebebe59bc9ef29b93984f94b4f5a6f Mon Sep 17 00:00:00 2001 From: Nicole Date: Fri, 2 Feb 2024 17:58:43 -0700 Subject: [PATCH 7/8] moved type from volumemounts to volumes Signed-off-by: Nicole --- .../templates/daemonset.yaml | 14 +++++++------- charts/prometheus-node-exporter/values.yaml | 10 ++++------ 2 files changed, 11 insertions(+), 13 deletions(-) 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. From acdc81cef5d53ce50797ab99fbe85a36df574a43 Mon Sep 17 00:00:00 2001 From: Nicole Date: Mon, 5 Feb 2024 09:00:32 -0700 Subject: [PATCH 8/8] spacing changes, deindentation changes Signed-off-by: Nicole --- charts/prometheus-node-exporter/templates/daemonset.yaml | 2 +- charts/prometheus-node-exporter/values.yaml | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/charts/prometheus-node-exporter/templates/daemonset.yaml b/charts/prometheus-node-exporter/templates/daemonset.yaml index ac137d2b86f9..77b578d562d4 100644 --- a/charts/prometheus-node-exporter/templates/daemonset.yaml +++ b/charts/prometheus-node-exporter/templates/daemonset.yaml @@ -273,7 +273,7 @@ spec: - name: {{ $mount.name }} hostPath: path: {{ $mount.hostPath }} - {{- with $mount.hostPath.type }} + {{- with $mount.type }} type: {{ . }} {{- end }} {{- end }} diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index 880952878f6a..6b81b6c8aaf4 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -317,12 +317,12 @@ hostRootFsMount: # https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation mountPropagation: HostToContainer -# Mount the node's proc file system (/) at /host/proc in the container +# 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 (/) at /host/sys in the container +# Mount the node's sys file system (/sys) at /host/sys in the container hostSysFsMount: # Possible values are None, HostToContainer, and Bidirectional mountPropagation: "" @@ -402,13 +402,12 @@ extraArgs: [] extraHostVolumeMounts: [] # - name: # hostPath: -# https://kubernetes.io/docs/concepts/storage/volumes/#hostpath-volume-types -# type: "" (Default)|DirectoryOrCreate|Directory|FileOrCreate|File|Socket|CharDevice|BlockDevice +# 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 - ## Additional configmaps to be mounted. ## configmaps: []