diff --git a/stable/prometheus-node-exporter/Chart.yaml b/stable/prometheus-node-exporter/Chart.yaml index cb473eacfb..0cd3c14ace 100644 --- a/stable/prometheus-node-exporter/Chart.yaml +++ b/stable/prometheus-node-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 0.18.1 description: A Helm chart for prometheus node-exporter name: prometheus-node-exporter -version: 1.9.0 +version: 1.9.1 home: https://github.com/prometheus/node_exporter/ sources: - https://github.com/prometheus/node_exporter/ diff --git a/stable/prometheus-node-exporter/README.md b/stable/prometheus-node-exporter/README.md index 0c0c43e07e..0ff7ffe6ae 100644 --- a/stable/prometheus-node-exporter/README.md +++ b/stable/prometheus-node-exporter/README.md @@ -52,6 +52,7 @@ The following table lists the configurable parameters of the Node Exporter chart | `service.port` | The service port | `9100` | | `service.targetPort` | The target port of the container | `9100` | | `service.nodePort` | The node port of the service | | +| `service.listenOnAllInterfaces` | If true, listen on all interfaces using IP `0.0.0.0`. Else listen on the IP address pod has been assigned by Kubernetes. | `true` | | `service.annotations` | Kubernetes service annotations | `{prometheus.io/scrape: "true"}` | | `serviceAccount.create` | Specifies whether a service account should be created. | `true` | | `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | | diff --git a/stable/prometheus-node-exporter/templates/daemonset.yaml b/stable/prometheus-node-exporter/templates/daemonset.yaml index 473a267897..765e538928 100644 --- a/stable/prometheus-node-exporter/templates/daemonset.yaml +++ b/stable/prometheus-node-exporter/templates/daemonset.yaml @@ -38,10 +38,20 @@ spec: args: - --path.procfs=/host/proc - --path.sysfs=/host/sys - - --web.listen-address=0.0.0.0:{{ .Values.service.port }} + - --web.listen-address=$(HOST_IP):{{ .Values.service.port }} {{- if .Values.extraArgs }} {{ toYaml .Values.extraArgs | indent 12 }} {{- end }} + env: + - name: HOST_IP + {{- if .Values.service.listenOnAllInterfaces }} + value: 0.0.0.0 + {{- else }} + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.hostIP + {{- end }} ports: - name: metrics containerPort: {{ .Values.service.targetPort }} diff --git a/stable/prometheus-node-exporter/values.yaml b/stable/prometheus-node-exporter/values.yaml index 1567c8726d..868bfcd71f 100644 --- a/stable/prometheus-node-exporter/values.yaml +++ b/stable/prometheus-node-exporter/values.yaml @@ -11,6 +11,7 @@ service: port: 9100 targetPort: 9100 nodePort: + listenOnAllInterfaces: true annotations: prometheus.io/scrape: "true"