CKA Troubleshooting Practice Question
A pod is stuck in 'Pending' state. You run 'kubectl describe pod mypod' and see: '0/4 nodes are available: 4 node(s) didn't match pod anti-affinity constraints'. What does this mean?
⚠ Common exam trap
The CKA exam often tests the distinction between anti-affinity, taints/tolerations, and node selectors; the trap here is that candidates misread 'anti-affinity constraints' as a generic scheduling failure and incorrectly choose resource exhaustion or taints.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The pod's anti-affinity rule conflicts with all existing pods on every node.
The error message '4 node(s) didn't match pod anti-affinity constraints' directly indicates that the pod's anti-affinity rule (defined in the pod spec under `affinity.podAntiAffinity`) prevents it from being scheduled on any node because the rule conflicts with the labels of existing pods on all nodes. Anti-affinity ensures the pod is not co-located with certain pods, and if every node already hosts a pod matching the anti-affinity selector, no node is eligible. This is distinct from taints, node selectors, or resource shortages.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The pod has a taint that no node tolerates.
Why it's wrong here
Taint and toleration issues are surfaced by the scheduler as events referencing the specific taint key, for example `0/3 nodes are available: 3 node(s) had taint {node-role.kubernetes.io/control-plane: }, that the pod didn't tolerate.` A taint that no node tolerates would produce this type of 'taint' message, not a message about pod anti-affinity rules. Since the described output points to anti-affinity, this option cannot be the reason the pod is Pending.
- ✗
The pod has a node selector that doesn't match any node.
Why it's wrong here
A node selector mismatch appears in scheduler events as `0/3 nodes are available: 3 node(s) didn't match node selector.` It indicates the pod's `nodeSelector` (or node affinity) could not be satisfied by any node's labels. This is a different diagnostic path than anti-affinity, which concerns pods already running on nodes rather than node labels. Therefore, a node selector that matches no node would not cause the described anti-affinity conflict.
- ✓
The pod's anti-affinity rule conflicts with all existing pods on every node.
Why this is correct
Pod anti-affinity enforces that a pod cannot share a topology domain with other pods that match a specified label selector. If the pod's `requiredDuringSchedulingIgnoredDuringExecution` anti-affinity rule targets pods that appear on every node within the cluster, then each node is disqualified and the scheduler reports something like `0/3 nodes are available: 3 node(s) didn't match pod anti-affinity rules.` This exactly matches the described output, confirming the conflict with existing pods is the cause of the Pending state.
- ✗
The cluster is out of resources.
Why it's wrong here
When the cluster is out of resources, the scheduler logs `Insufficient memory`, `Insufficient cpu`, or `Insufficient ephemeral-storage` in node availability messages, and the pod remains Pending until capacity frees up. This is a node-capacity problem, not a pod-level scheduling rule, so it would not be described as an anti-affinity mismatch. Since the described output shows the failure relates to pod anti-affinity, the 'out of resources' explanation is incorrect.
Go deeper
Related to this question
About these practice questions
One of 726 original CKA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKA exam.