Bird
0
0

Given this pod spec snippet with required node affinity for label zone: us-west, what happens if no nodes have this label?

medium📝 Command Output Q4 of 15
Kubernetes - Scheduling
Given this pod spec snippet with required node affinity for label zone: us-west, what happens if no nodes have this label?
AThe pod will schedule on any node ignoring affinity
BThe pod will remain pending and not schedule
CThe pod will schedule but restart continuously
DThe pod will be deleted automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand required node affinity behavior

    Required node affinity means the pod must be scheduled on nodes matching the label; if none match, scheduling fails.
  2. Step 2: Determine pod state when no matching nodes exist

    Without matching nodes, the pod stays in Pending state until a suitable node appears.
  3. Final Answer:

    The pod will remain pending and not schedule -> Option B
  4. Quick Check:

    Required affinity unmet = pod pending [OK]
Quick Trick: Pod stays pending if required node affinity not met [OK]
Common Mistakes:
  • Assuming pod schedules ignoring required affinity
  • Thinking pod restarts or deletes automatically
  • Confusing preferred affinity behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes