You have deployed a DaemonSet to run a logging agent on every node. After an update, the new pods are stuck in 'Pending' state. You run 'kubectl describe pod ds-pod-xxxxx' and see '0/3 nodes are available: 3 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate'. What is the MOST likely cause?
This is correct: DaemonSet pods, like all pods, are subject to taints and tolerations. If a node has a taint, the DaemonSet pod template must include the matching toleration; otherwise, the scheduler will leave the pod Pending with an event like '0/N nodes are available: N node(s) had taint {key=value:NoSchedule}, that the pod didn't tolerate.' The DaemonSet controller can only create pods; it cannot bypass the scheduler's taint rules.
Why this answer
The error message indicates that the pod cannot be scheduled because all three nodes have a taint (specifically `node-role.kubernetes.io/master`), and the DaemonSet's pod template does not include a corresponding toleration. By default, control-plane nodes are tainted to prevent general workloads from running on them, so a DaemonSet intended to run on all nodes must include tolerations for these taints. Without tolerations, the scheduler will not place the pod on tainted nodes, leaving it in Pending state.
Exam trap
The trap here is that candidates often assume DaemonSets automatically run on all nodes regardless of taints, but in reality, DaemonSets respect taints and tolerations just like any other workload, and failing to add tolerations for control-plane taints is a common misconfiguration.
How to eliminate wrong answers
Option A is wrong because a nodeSelector mismatch would produce a different error (e.g., '0/3 nodes are available: 3 node(s) didn't match node selector'), not a taint-related message. Option B is wrong because hostNetwork conflicts would cause pod startup failures (e.g., port collisions) or CrashLoopBackOff, not a scheduling failure due to taints. Option D is wrong because cordoned nodes would show a specific condition like 'node(s) cordoned' in the describe output, not a taint-based message; cordoning prevents new pods from being scheduled but does not produce a taint-related error.