Skip to content

Commit 45e7a3c

Browse files
committed
[prometheus] make path.rootfs condition
Not always possible to mount / from host, see issue prometheus-community#467
1 parent 1a48c84 commit 45e7a3c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

charts/prometheus/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: prometheus
3-
version: 13.4.0
3+
version: 13.4.1
44
appVersion: 2.24.0
55
description: Prometheus is a monitoring system and time series database.
66
home: https://prometheus.io/

charts/prometheus/templates/node-exporter/daemonset.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ spec:
4545
args:
4646
- --path.procfs=/host/proc
4747
- --path.sysfs=/host/sys
48+
{{- if .Values.nodeExporter.hostRootfs }}
4849
- --path.rootfs=/host/root
50+
{{- end }}
4951
{{- if .Values.nodeExporter.hostNetwork }}
5052
- --web.listen-address=:{{ .Values.nodeExporter.service.hostPort }}
5153
{{- end }}
@@ -73,10 +75,12 @@ spec:
7375
- name: sys
7476
mountPath: /host/sys
7577
readOnly: true
78+
{{- if .Values.nodeExporter.hostRootfs }}
7679
- name: root
7780
mountPath: /host/root
7881
mountPropagation: HostToContainer
7982
readOnly: true
83+
{{- end }}
8084
{{- range .Values.nodeExporter.extraHostPathMounts }}
8185
- name: {{ .name }}
8286
mountPath: {{ .mountPath }}
@@ -123,9 +127,11 @@ spec:
123127
- name: sys
124128
hostPath:
125129
path: /sys
130+
{{- if .Values.nodeExporter.hostRootfs }}
126131
- name: root
127132
hostPath:
128133
path: /
134+
{{- end }}
129135
{{- range .Values.nodeExporter.extraHostPathMounts }}
130136
- name: {{ .name }}
131137
hostPath:

charts/prometheus/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ nodeExporter:
442442
##
443443
hostPID: true
444444

445+
## If true, node-exporter pods mounts host / at /host/root
446+
##
447+
hostRootfs: true
448+
445449
## node-exporter container name
446450
##
447451
name: node-exporter

0 commit comments

Comments
 (0)