DaemonSets and Node Eligibility
"A DaemonSet runs one Pod on every node" is the definition everyone learns and it is not what the controller does. It runs one Pod on every node that will accept one, and the number it reports as DESIRED is the result of that filtering rather than a count of your nodes. Four nodes, three Pods, and the missing one explained and then fixed.
Scheduling and Placement Guide 16 of 46 Beginner
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 12 min
DaemonSet Pods are scheduled by the default scheduler and are subject to taints like anything else. They do get some tolerations added automatically - node.kubernetes.io/disk-pressure, unschedulable and similar - so that a node agent is not evicted by the conditions it exists to report on. The control-plane taint is not among them.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a DaemonSet reports fewer Pods than the cluster has nodes and nothing looks broken. This matters because "one Pod on every node" is the definition everyone learns and not what the controller does - eligibility is decided by taints.
- creating a DaemonSet with no node selector and no tolerations across a four-node cluster
- putting Pod placement beside node taints to find the node that refused
- adding a toleration for that exact taint and watching the controller recompute DESIRED and READY
- reading a DaemonSet's counts as eligible nodes rather than total nodes
Before you start
- A cluster with at least one tainted node - a kubeadm control plane is tainted by default, which is all this needs.
- The session creates namespace
kx-dsand a DaemonSetagent, first without tolerations and then with one.
-
One per node, supposedly
-
The node that said no
-
Tolerate it and count again