Skip to content

Commit

Permalink
[prometheus] make path.rootfs conditional (#737)
Browse files Browse the repository at this point in the history
* [prometheus] make path.rootfs condition

Not always possible to mount / from host, see issue #467

Signed-off-by: William Johansson <[email protected]>

* [prometheus] bump minor version

Signed-off-by: William Johansson <[email protected]>

* [prometheus] bump minor version

Signed-off-by: William Johansson <[email protected]>

Co-authored-by: André Bauer <[email protected]>
  • Loading branch information
radhus and monotek authored Mar 10, 2021
1 parent 0ec6d33 commit 46c8e5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: prometheus
version: 13.5.0
appVersion: 2.24.0
version: 13.6.0
description: Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png
Expand Down
6 changes: 6 additions & 0 deletions charts/prometheus/templates/node-exporter/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ spec:
args:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
{{- if .Values.nodeExporter.hostRootfs }}
- --path.rootfs=/host/root
{{- end }}
{{- if .Values.nodeExporter.hostNetwork }}
- --web.listen-address=:{{ .Values.nodeExporter.service.hostPort }}
{{- end }}
Expand Down Expand Up @@ -73,10 +75,12 @@ spec:
- name: sys
mountPath: /host/sys
readOnly: true
{{- if .Values.nodeExporter.hostRootfs }}
- name: root
mountPath: /host/root
mountPropagation: HostToContainer
readOnly: true
{{- end }}
{{- range .Values.nodeExporter.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
Expand Down Expand Up @@ -123,9 +127,11 @@ spec:
- name: sys
hostPath:
path: /sys
{{- if .Values.nodeExporter.hostRootfs }}
- name: root
hostPath:
path: /
{{- end }}
{{- range .Values.nodeExporter.extraHostPathMounts }}
- name: {{ .name }}
hostPath:
Expand Down
4 changes: 4 additions & 0 deletions charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ nodeExporter:
##
hostPID: true

## If true, node-exporter pods mounts host / at /host/root
##
hostRootfs: true

## node-exporter container name
##
name: node-exporter
Expand Down

0 comments on commit 46c8e5a

Please sign in to comment.