Last reviewed: November 14, 2026 (Asia/Shanghai); primary references checked November 13 UTC.
Direct answer
Review a Kubernetes DaemonSet patch by mapping the nodes that must retain the daemon, checking how the rendered template selects those nodes, and calculating the replacement policy for that node set. Inspect actual controller-created Pods because their affinity and tolerations can differ from the template. During a test update, require evidence that the candidate daemon becomes available on every intended node; matching aggregate counts can conceal a coverage change or an unavailable new Pod beside a healthy old one.
The DaemonSet concept reference defines node coverage and controller behavior. The rolling-update task explains template updates and common stalls. The DaemonSet API reference defines update allowances and the status fields needed to interpret the result.
Who this is for
Use this workflow when a coding agent changes an apps/v1 DaemonSet, or chart values and overlays that render one. Typical workloads include node monitoring, log collection, storage helpers, and networking components. A missing daemon on one node can matter even when the rest of the fleet is healthy, so give the agent a node-coverage contract before asking it to adjust an update strategy.
Record the target Kubernetes version, required node pools, accepted coverage interruption, and whether two daemon versions may coexist on a node. The fragments and test cases below are proposed review checks; no authenticated cluster tests or deployments were performed for this article.
Key takeaways
- Compare intended node identities with actual coverage, including nodes excluded by a changed label rule.
- Review the DaemonSet template and its created Pods separately; the controller adds scheduling details.
- A node cordon alone does not exclude DaemonSet Pods because the controller adds an unschedulable-node toleration.
- Percentage
maxUnavailablerounds up for DaemonSets; do the arithmetic for the actual eligible node count. - Surge updates require capacity and compatibility for overlapping daemon versions on the same node.
updatedNumberScheduledandnumberAvailabledescribe different observations; inspect candidate Pods on each node.
Sources checked
Three primary Kubernetes pages were retrieved successfully on November 13, 2026 UTC:
- DaemonSet documents node selection, immutable selectors, generated Pod affinity, automatic tolerations, and coverage changes after node-label changes. Its displayed modification date is September 12, 2026.
- Perform a Rolling Update on a DaemonSet
documents
OnDelete,RollingUpdate, template-triggered replacement, and resource or unhealthy-template stalls. Its displayed modification date is August 24, 2023. - DaemonSet API reference
defines
minReadySeconds, unavailable and surge allowances, and node-based status counters. It identifies an August 26, 2026 update for Kubernetes v1.37.
These maintained references support an evergreen review task. Match their fields to the target cluster version. For surge behavior, use the API’s explicit overlap definition: the older task page’s general single-Pod wording should not be applied to a surge-enabled update.
Contract details to verify
Define coverage as a list of nodes
Render every affected environment from the candidate revision. Compare the complete selector, Pod labels, node selector, affinity, tolerations, images, readiness settings, and resource requests. The DaemonSet’s .spec.selector must match its Pod-template labels and cannot be changed after creation. Treat a proposed delete-and-recreate workaround as a separate replacement operation requiring its own coverage plan.
Write an acceptance statement such as: “The collector must run on every Linux worker in the approved telemetry pool; control-plane nodes are excluded; at most one selected node may temporarily lack an available collector during replacement.” List the actual node names and labels supporting that contract. Keep this intended set separate from the controller’s reported desired count.
The concept reference states that node-label changes can cause the DaemonSet to add Pods on newly matching nodes and delete Pods from nodes that no longer match. Therefore, a shrinking desiredNumberScheduled is not automatically a successful cleanup. A patch can make all counters agree by removing a required node from the selected set. Compare before-and-after node identities and obtain the owner’s decision for every removal.
When selection rules change, use the node-affinity review workflow to check the rendered selection logic and label ownership. Then verify the DaemonSet-specific response to that selection; an ordinary Pod’s affinity behavior alone does not establish the controller’s coverage behavior.
Inspect the controller-created Pod
The DaemonSet controller evaluates the template’s node affinity to identify eligible nodes. It then creates a Pod for a target node and replaces that original node-affinity rule on the created Pod with a rule matching the target node’s name. The scheduler normally performs the final binding. A hostname-based affinity rule on an actual Pod is therefore not, by itself, evidence that the agent’s pool-selection rule disappeared incorrectly.
Retain both objects: the DaemonSet template explains eligibility, while the admitted Pod shows the effective scheduling configuration. Confirm the Pod’s controlling owner reference matches the DaemonSet UID before counting it as coverage. Labels alone can also match unrelated objects.
The controller automatically adds tolerations, including node.kubernetes.io/unschedulable:NoSchedule and node-failure NoExecute tolerations. Consequently, marking a node unschedulable does not establish that the daemon will stay off it. Do not use a cordon as the only exclusion mechanism in a coverage test.
Review custom tolerations and control-plane access separately. The automatic list is not a reason to add a wildcard toleration to solve an unexplained Pending Pod. The taints and tolerations review guide covers matching rules; inspect the generated Pod when applying those checks to a DaemonSet.
Calculate the replacement policy in nodes
RollingUpdate is the default strategy. A Pod-template change causes controlled automatic replacement. With OnDelete, changing the template does not automatically replace existing Pods; the operating procedure must deliberately replace old Pods. Do not approve an OnDelete change while assuming that applying a new image will update every running daemon.
The API defines default maxUnavailable as one and default maxSurge as zero. Both cannot be zero. For percentage maxUnavailable, Kubernetes rounds up. These examples apply maxUnavailable: "25%" to a healthy starting set:
| Eligible nodes | Unavailable allowance, rounded up | Selected nodes outside that allowance |
|---|---|---|
| 1 | 1 | 0 |
| 3 | 1 | 2 |
| 4 | 1 | 3 |
| 5 | 2 | 3 |
The last column describes the configured replacement allowance, not protection against independent failures. A percentage that looks conservative can permit the only daemon to be unavailable in a single-node fixture. Recalculate after node-pool changes instead of copying Deployment percentage arithmetic.
For the illustrative collector contract, this fragment belongs under an existing DaemonSet’s spec, alongside its reviewed selector and template:
minReadySeconds: 20
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 0
The API defines availability here as a new Pod remaining ready for the specified duration without a container crashing. The 20-second value is illustrative. Verify that the readiness check measures useful daemon behavior; a timer cannot compensate for a check that reports success before collection or networking works.
An alternative maxUnavailable: 0, maxSurge: 1 strategy allows an updated Pod alongside an existing available Pod before deleting the old one. Percentage surge values round up, with a minimum of one. Review this as a per-node coexistence requirement: a spare node elsewhere does not provide memory on the node receiving the overlapping daemon.
The API warns that surge can double daemon resource consumption on a node. If the daemon uses host ports, a local socket, or shared host state, require a coexistence test as well as a capacity calculation. Also avoid treating surge as an absolute Pod-count ceiling: the API permits immediate updated-Pod creation when an old Pod becomes unavailable, without considering surge limits.
Separate current coverage from candidate availability
Capture controller observation of the candidate generation before interpreting counters. These read-only examples assume kubectl and jq; replace the context, namespace, workload name, and label selector with the actual fixture values:
kubectl --context review-cluster get nodes \
-L kubernetes.io/os,workload.example.com/pool
kubectl --context review-cluster --namespace agent-review \
get daemonset node-collector -o json |
jq '{uid: .metadata.uid,
generation: .metadata.generation,
observedGeneration: .status.observedGeneration,
desired: .status.desiredNumberScheduled,
current: .status.currentNumberScheduled,
updated: .status.updatedNumberScheduled,
ready: .status.numberReady,
available: .status.numberAvailable,
unavailable: .status.numberUnavailable,
misscheduled: .status.numberMisscheduled,
template: .spec.template}'
kubectl --context review-cluster --namespace agent-review \
get pods -l app=node-collector -o json |
jq '.items[] | {name: .metadata.name,
uid: .metadata.uid,
owners: .metadata.ownerReferences,
node: .spec.nodeName,
affinity: .spec.affinity,
tolerations: .spec.tolerations,
images: [.spec.containers[].image],
deletionTimestamp: .metadata.deletionTimestamp,
conditions: .status.conditions,
containers: .status.containerStatuses}'
The API defines desiredNumberScheduled as nodes that should run the daemon, updatedNumberScheduled as nodes running an updated daemon Pod, and numberAvailable as nodes with at least one available daemon Pod. During surge, an old Pod can supply availability while the new Pod on that node is unready. Even equal desired, updated, and available counts are insufficient evidence that every candidate Pod is available.
Build a node-to-Pod map using owner references, UIDs, candidate template identity, readiness transitions, and deletion state. At completion, require an available candidate on each intended node and account for old Pods still terminating. Confirm the daemon’s useful function on each node through a harmless application-level check, such as receipt of a fixture telemetry record. Controller readiness alone does not prove delivery to an external collector.
Test changes to membership and updates separately
Use an approved disposable environment with representative node labels and enough eligible nodes to exercise the allowance. Establish a healthy baseline before each case and restore it afterward. These are proposed acceptance cases, not reported outcomes:
| Controlled case | Evidence required |
|---|---|
| Healthy template update with unchanged node membership | Candidate becomes available on each intended node; observations distinguish old and new Pod UIDs |
| One fixture node gains or loses the selection label | Coverage changes on that exact node; any removal agrees with the approved contract |
| Candidate cannot become ready | Pod events and readiness observations explain stalled replacement; remaining old coverage is recorded |
| Surge-enabled update | Both versions can coexist on a node with adequate resources and acceptable daemon behavior |
OnDelete template change, if proposed | Existing old Pods remain until deliberate replacement; each approved replacement uses the candidate template |
For a stalled node, retain its Pod description and events before editing anything else. The update task identifies insufficient resources and broken images or crash loops as common causes. Diagnose the specific cause instead of having the agent widen node selection, add broad tolerations, or remove unrelated workloads merely to obtain a green result.
Bind observations to the rendered candidate and DaemonSet UID. If another template update begins, restart the candidate-specific assessment; a later healthy template cannot supply evidence for the earlier patch. Plan recovery through the approved release procedure and verify restored per-node function after it runs.
Failure modes
All counters agree after a required node disappears. Compare node identities with the coverage contract. A smaller selected set can hide an unintended exclusion.
A cordoned node is assumed to reject daemon Pods. Inspect controller-added tolerations and test the intended exclusion through the actual DaemonSet path.
A one-node fixture makes a percentage look harmless. Calculate the rounded allowance explicitly; a positive unavailable percentage can allow that node’s daemon to be unavailable.
Surge is enabled without checking local coexistence. Verify capacity and shared host resources on the same node, then test both daemon versions together.
An old healthy Pod supplies the candidate’s success evidence. Inspect each updated Pod’s identity and availability interval instead of relying on aggregate availability.
FAQ
Does a DaemonSet always run exactly one Pod per node?
That describes its normal coverage goal for eligible nodes. A surge-enabled update can overlap an old and new Pod on a node. Inspect the update strategy before treating an overlap as an error.
Does OnDelete stop the controller from creating any new Pods?
No. It changes replacement of existing old Pods after a template update. The controller still manages node coverage; do not interpret it as a global creation pause.
Is numberReady sufficient when minReadySeconds is positive?
No. Ready and available are separate API observations. Availability includes the minimum ready duration; candidate identity and per-node function still need their own evidence.
Reader next step
Choose one agent-written DaemonSet change. Attach the intended node list, rendered template, effective Pod scheduling fields, and integer update allowances to its pull request. In the disposable environment, exercise a healthy update and the changed membership or surge boundary. Keep a node-to-Pod evidence map showing candidate identity, availability, and useful daemon behavior so the reviewer can see exactly which nodes the patch covers.