DaemonSets: Node-Level System Agents
A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected.
1. Common Production Use Cases
Section titled “1. Common Production Use Cases”- Log Collection: Running
fluentd,promtail, orlogstashon every node. - Cluster Monitoring: Running node metrics exporters like
node-exporterordatadog-agent. - Cluster Networking: Running CNI network agents like
calico-node,cilium-agent, orkube-flannel.
2. DaemonSet Manifest Example
Section titled “2. DaemonSet Manifest Example”apiVersion: apps/v1kind: DaemonSetmetadata: name: node-exporter namespace: monitoringspec: selector: matchLabels: app: node-exporter template: metadata: labels: app: node-exporter spec: containers: - name: node-exporter image: prom/node-exporter:v1.7.0 ports: - containerPort: 9100 hostPort: 9100 name: metrics