Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-node-exporter] Parameterise host root FS mount propagation #1583

Merged
merged 5 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions charts/prometheus-node-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ apiVersion: v2
name: prometheus-node-exporter
description: A Helm chart for prometheus node-exporter
keywords:
- node-exporter
- prometheus
- exporter
- node-exporter
- prometheus
- exporter
type: application
version: 2.5.0
version: 3.0.0
appVersion: 1.3.1
home: https://github.com/prometheus/node_exporter/
sources:
- https://github.com/prometheus/node_exporter/
- https://github.com/prometheus/node_exporter/
maintainers:
- email: [email protected]
name: gianrubio
- name: bismarck
- email: [email protected]
name: gianrubio
- name: bismarck
16 changes: 16 additions & 0 deletions charts/prometheus-node-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ helm upgrade [RELEASE_NAME] [CHART] --install

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

### From 2.x to 3.x

Change the following:

```yaml
hostRootFsMount: true
```

to:

```yaml
hostRootFsMount:
enabled: true
mountPropagation: HostToContainer
```

## Configuring

See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:
Expand Down
10 changes: 6 additions & 4 deletions charts/prometheus-node-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
args:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
{{- if .Values.hostRootFsMount }}
{{- if .Values.hostRootFsMount.enabled }}
- --path.rootfs=/host/root
{{- end }}
- --web.listen-address=$(HOST_IP):{{ .Values.service.port }}
Expand Down Expand Up @@ -82,10 +82,12 @@ spec:
- name: sys
mountPath: /host/sys
readOnly: true
{{- if .Values.hostRootFsMount }}
{{- if .Values.hostRootFsMount.enabled }}
- name: root
mountPath: /host/root
mountPropagation: HostToContainer
{{- with .Values.hostRootFsMount.mountPropagation }}
mountPropagation: {{ . }}
{{- end }}
readOnly: true
{{- end }}
{{- if .Values.extraHostVolumeMounts }}
Expand Down Expand Up @@ -153,7 +155,7 @@ spec:
- name: sys
hostPath:
path: /sys
{{- if .Values.hostRootFsMount }}
{{- if .Values.hostRootFsMount.enabled }}
- name: root
hostPath:
path: /
Expand Down
12 changes: 9 additions & 3 deletions charts/prometheus-node-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,15 @@ hostNetwork: true
# Share the host process ID namespace
hostPID: true

## If true, node-exporter pods mounts host / at /host/root
##
hostRootFsMount: true
# Mount the node's root file system (/) at /host/root in the container
hostRootFsMount:
monotek marked this conversation as resolved.
Show resolved Hide resolved
enabled: true
# Defines how new mounts in existing mounts on the node or in the container
# are propagated to the container or node, respectively. Possible values are
# None, HostToContainer, and Bidirectional. If this field is omitted, then
# None is used. More information on:
# https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation
mountPropagation: HostToContainer

## Assign a group of affinity scheduling rules
##
Expand Down