--- apiVersion: apps/v1 kind: DaemonSet metadata: name: node-exporter namespace: monitoring labels: app: node-exporter spec: selector: matchLabels: app: node-exporter updateStrategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 template: metadata: labels: app: node-exporter spec: hostNetwork: true hostPID: true nodeSelector: kubernetes.io/os: linux tolerations: # Run on all nodes including master - operator: Exists effect: NoSchedule containers: - name: node-exporter image: quay.io/prometheus/node-exporter:v1.7.0 args: - '--path.sysfs=/host/sys' - '--path.rootfs=/host/root' - '--path.procfs=/host/proc' - '--collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/)' - '--collector.filesystem.fs-types-exclude=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$' - '--collector.netclass.ignored-devices=^(veth.*|[a-f0-9]{15})$' - '--collector.netdev.device-exclude=^(veth.*|[a-f0-9]{15})$' - '--web.listen-address=:9100' ports: - containerPort: 9100 protocol: TCP name: metrics resources: requests: memory: "64Mi" cpu: "50m" limits: memory: "128Mi" cpu: "200m" volumeMounts: - name: sys mountPath: /host/sys mountPropagation: HostToContainer readOnly: true - name: root mountPath: /host/root mountPropagation: HostToContainer readOnly: true - name: proc mountPath: /host/proc mountPropagation: HostToContainer readOnly: true securityContext: runAsNonRoot: true runAsUser: 65534 capabilities: drop: - ALL readOnlyRootFilesystem: true volumes: - name: sys hostPath: path: /sys - name: root hostPath: path: / - name: proc hostPath: path: /proc --- apiVersion: v1 kind: Service metadata: name: node-exporter namespace: monitoring labels: app: node-exporter annotations: prometheus.io/scrape: "true" prometheus.io/port: "9100" spec: clusterIP: None ports: - name: metrics port: 9100 protocol: TCP targetPort: 9100 selector: app: node-exporter