diff --git a/prometheus-node-exporter/templates/bin/_node-exporter.sh.tpl b/prometheus-node-exporter/templates/bin/_node-exporter.sh.tpl index 9fb57e373..60ee2cedd 100644 --- a/prometheus-node-exporter/templates/bin/_node-exporter.sh.tpl +++ b/prometheus-node-exporter/templates/bin/_node-exporter.sh.tpl @@ -20,4 +20,7 @@ set -ex exec /bin/node_exporter \ {{ tuple "--collector." .Values.conf.collectors.enable | include "helm-toolkit.utils.joinListWithPrefix" }} \ {{ tuple "--no-collector." .Values.conf.collectors.disable | include "helm-toolkit.utils.joinListWithPrefix" }} \ + {{ if .Values.conf.collectors.textfile.directory }} \ + --collector.textfile.directory={{.Values.conf.collectors.textfile.directory }} \ + {{- end }} --collector.ntp.server={{ .Values.conf.ntp_server_ip }} diff --git a/prometheus-node-exporter/templates/daemonset.yaml b/prometheus-node-exporter/templates/daemonset.yaml index b659ad775..93724cc56 100644 --- a/prometheus-node-exporter/templates/daemonset.yaml +++ b/prometheus-node-exporter/templates/daemonset.yaml @@ -88,6 +88,11 @@ spec: - name: sys mountPath: /host/sys readOnly: true +{{ if .Values.conf.collectors.textfile.directory }} + - name: stats-out + mountPath: {{.Values.conf.collectors.textfile.directory }} + readOnly: true +{{ end }} - name: node-exporter-bin mountPath: /tmp/node-exporter.sh subPath: node-exporter.sh @@ -99,6 +104,11 @@ spec: - name: sys hostPath: path: /sys +{{ if .Values.conf.collectors.textfile.directory }} + - name: stats-out + hostPath: + path: {{.Values.conf.collectors.textfile.directory }} +{{ end }} - name: node-exporter-bin configMap: name: node-exporter-bin diff --git a/prometheus-node-exporter/values.yaml b/prometheus-node-exporter/values.yaml index 7da4104eb..59105125e 100644 --- a/prometheus-node-exporter/values.yaml +++ b/prometheus-node-exporter/values.yaml @@ -154,3 +154,5 @@ conf: - bonding - mountstats disable: + textfile: + directory: /var/log/node-exporter-vfstats