Bird
0
0

If a pod has a preferred podAntiAffinity rule to avoid nodes with pods labeled app: cache, what is the expected behavior when all nodes have such pods?

medium📝 Predict Output Q5 of 15
Kubernetes - Scheduling
If a pod has a preferred podAntiAffinity rule to avoid nodes with pods labeled app: cache, what is the expected behavior when all nodes have such pods?
AThe pod will remain pending indefinitely
BThe pod will be scheduled on any node despite the preference
CThe pod will be scheduled only on nodes without <code>app: cache</code> pods
DThe pod will be deleted automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand preferred podAntiAffinity behavior

    Preferred podAntiAffinity is a soft rule; scheduler tries to avoid matching nodes but can ignore if no alternatives.
  2. Step 2: Analyze scenario

    Since all nodes have pods with label app=cache, the pod will be scheduled anyway despite preference.
  3. Final Answer:

    The pod will be scheduled on any node despite the preference -> Option B
  4. Quick Check:

    Preferred podAntiAffinity is a soft avoidance, not blocking [OK]
Quick Trick: Preferred anti-affinity is a soft rule, pod schedules anyway if needed [OK]
Common Mistakes:
  • Thinking preferred rules block scheduling
  • Confusing preferred with required affinity
  • Assuming pod deletion on rule violation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes