diff --git a/infrastructures/prometheus-exporters/env/k3s-cluster/node-exporter.yaml b/infrastructures/prometheus-exporters/env/k3s-cluster/node-exporter.yaml index 5caa367..ae6ab1c 100644 --- a/infrastructures/prometheus-exporters/env/k3s-cluster/node-exporter.yaml +++ b/infrastructures/prometheus-exporters/env/k3s-cluster/node-exporter.yaml @@ -14,10 +14,15 @@ spec: metadata: labels: app: prometheus-node-exporter + annotations: + prometheus.io/scrape: "true" + prometheus.io/path: '/metrics' + prometheus.io/port: "9100" spec: hostNetwork: true hostPID: true hostIPC: true + enableServiceLinks: false topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname @@ -29,16 +34,27 @@ spec: - name: prometheus-node-exporter image: prom/node-exporter args: - - "--path.rootfs=/host" + - "--path.rootfs=/root" + - "--path.sysfs=/host/sys" + - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/) + - --collector.netclass.ignored-devices=^(veth.*)$ + ports: + - containerPort: 9100 + protocol: TCP volumeMounts: - - name: node-volume - mountPath: /host + - name: sys + mountPath: /host/sys + mountPropagation: HostToContainer + - name: root + mountPath: /root readOnly: true mountPropagation: HostToContainer securityContext: privileged: true volumes: - - name: node-volume + - name: sys hostPath: - path: / - type: Directory \ No newline at end of file + path: /sys + - name: root + hostPath: + path: / \ No newline at end of file