DaemonSet eligibility
Why a workload follows nodes
A web catalog needs enough interchangeable replicas to serve requests. A node heartbeat agent has a different purpose: it reports from each eligible machine. A DaemonSet expresses that coverage goal. It does not expose a replica-count setting like a Deployment. When a matching node joins, the controller aims to place a copy there; when a node leaves or no longer matches, the desired coverage changes. The word eligible matters: the total node count and desired daemon coverage can differ. This is a node-local workload, not a promise that every machine is healthy.
Select the intended machines
nodeSelector: kubernetes.io/os: linux study.example.com/agent: enabledtolerations:- key: study.example.com/dedicated operator: Equal value: observability effect: NoScheduleRead the selector and toleration
This fragment belongs inside spec.template.spec of a DaemonSet. Both node labels must match. A taint is a node-side scheduling restriction; a toleration is permission to pass a matching restriction, not a request to choose that node. The exact custom taint shown permits observability nodes but not nodes reserved for database workloads. The DaemonSet selector under spec.selector matches Pod labels, not Node labels. Inspect the full heartbeat.yaml in the offline fixtures.
Predict coverage before scheduling
The synthetic inventory contains workers a through e. Workers a, b and e match the two node labels and custom taint rules. Worker c has agent=disabled; worker d carries a database NoSchedule taint, which the example does not tolerate. Worker b is cordoned (marked unschedulable), but DaemonSet Pods receive an automatic toleration for that restriction. Other built-in tolerations also exist, including for not-ready and unreachable nodes. Do not infer readiness from toleration. This example omits all other policies.
Eligibility does not guarantee execution
The controller targets each eligible node with node-specific affinity; the scheduler still needs to place the Pod. Worker e has 10m of free CPU in the fixture, but the agent requests 25m. With preemption and other changes excluded from this toy model, only workers a and b fit. Real placement also depends on memory, admission, scheduler policy, priority and node conditions. Do not remove resource requests or custom taints merely to make a Pod run.
Read the coverage snapshot
{ "desiredNumberScheduled": 3, "currentNumberScheduled": 3, "numberReady": 2, "numberAvailable": 2, "numberMisscheduled": 0}Interpret counts and practice
These are counts of nodes in the relevant categories, not a general count of all Pod objects. The snapshot reports three intended nodes with daemon Pods, two ready and two available; no node outside intended coverage is reported as misscheduled. Status alone does not establish the exact cause of the third failure. Compare nodes.json and status.json to identify the CPU shortage in this synthetic case. In a real approved lab, examine the corresponding Pod and events. Predict coverage if worker c changes its agent label to enabled, keeping the other inputs unchanged. The result is four eligible nodes; actual execution remains separate.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
DaemonSet eligibility — knowledge check
Apply the chapter concepts using synthetic offline scenarios.
What controls the desired coverage of this DaemonSet?
A node matches both labels but carries a database NoSchedule taint. The example tolerates only observability. What follows?
Why is a cordoned but otherwise eligible node not necessarily excluded?
A matching node has 10m free CPU and the agent requests 25m. Assume no preemption or other changes. What is true?
Desired=5, current=5, ready=4. Which conclusion is justified?