Node Exporter¶
Node Exporter is a host-level monitoring agent deployed to collect and expose hardware and OS-level Metrics from compute nodes^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md]. It functions as a data collector that provides an HTTP interface for monitoring systems like Prometheus to scrape metrics^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md].
Deployment in Kubernetes¶
In Kubernetes environments, the Node Exporter is typically deployed as a [[daemonset|DaemonSet]] to ensure that a single instance runs on every node in the cluster^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md]. To facilitate the collection of host-level Metrics, the pod requires specific access to the node's file systems. This is achieved by mounting host paths, such as /proc and /sys, as volumes inside the container^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md].
The configuration typically utilizes hostNetwork: true to expose the Metrics port directly on the node's IP address^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md]. By default, Node Exporter exposes Metrics on port 9100^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md].
Configuration¶
When defining the container for Node Exporter, arguments are often specified to map the mounted host paths to the correct filesystem paths expected by the exporter^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md]:
--path.procfs: Specifies the path to the proc filesystem (e.g.,/host_proc).--path.sysfs: Specifies the path to the sys filesystem (e.g.,/host_sys).
Volume mounts are configured with read-only access to these host paths^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md].
Related Concepts¶
- Prometheus
- cAdvisor
- [[daemonset|DaemonSet]]
- [[monitoring|Monitoring]]
Sources¶
^[400-devops__06-Kubernetes__k8s-paas__07.Promtheus监控k8s企业级应用.md]