Skip to content

Commit

Permalink
[prometheus] make path.rootfs condition
Browse files Browse the repository at this point in the history
Not always possible to mount / from host, see issue prometheus-community#467
  • Loading branch information
radhus committed Mar 7, 2021
1 parent 1a48c84 commit 45e7a3c
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,6 +1,6 @@
apiVersion: v2
name: prometheus
version: 13.4.0
version: 13.4.1
appVersion: 2.24.0
description: Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
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 45e7a3c

Please sign in to comment.