DaemonSets: Per-Node Agents
Key Takeaways for AI & Readers
- Scope: Ensures one copy of a Pod runs on every Node in the cluster.
- Use Cases: Log collectors (Fluentd), monitoring agents (Prometheus), and CNI plugins.
- Scaling: Automatically adds Pods to new nodes as they join the cluster.
Notice: You don't scale the pods directly. You scale the Nodes, and the Daemon Controller automatically schedules a pod on the new node.
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.
Use Cases
- Cluster Storage Daemon: running
glusterd,ceph, etc. on each node. - Logs Collection: running
fluentdorlogstashon every node. - Node Monitoring: running
Prometheus Node Exporter,collectd, orDatadog agenton every node.
How it works
The DaemonSet controller ensures that a Pod matches its selector on every node.
Taints and Tolerations
DaemonSet Pods often need to run on nodes that are otherwise tainted (like the Control Plane nodes). Most DaemonSets include tolerations for these taints automatically or require you to add them to ensure full cluster coverage.