Bird
0
0

What is the effect of specifying preferredDuringSchedulingIgnoredDuringExecution node affinity in a pod spec?

medium📝 Command Output Q5 of 15
Kubernetes - Scheduling
What is the effect of specifying preferredDuringSchedulingIgnoredDuringExecution node affinity in a pod spec?
AThe pod will be deleted if no preferred nodes are found
BThe scheduler tries to place the pod on matching nodes but allows others if none match
CThe pod will only schedule on nodes that match the preference
DThe pod will restart until scheduled on preferred nodes
Step-by-Step Solution
Solution:
  1. Step 1: Understand preferredDuringScheduling behavior

    This affinity is a soft preference; scheduler tries to place pod on matching nodes but can schedule elsewhere if needed.
  2. Step 2: Match behavior with options

    The scheduler tries to place the pod on matching nodes but allows others if none match correctly describes this behavior; others describe hard requirements or pod deletion/restart which are incorrect.
  3. Final Answer:

    The scheduler tries to place the pod on matching nodes but allows others if none match -> Option B
  4. Quick Check:

    Preferred affinity = soft scheduling preference [OK]
Quick Trick: Preferred affinity is a soft scheduling preference [OK]
Common Mistakes:
  • Confusing preferred with required affinity
  • Assuming pod deletion or restart on no match
  • Thinking preferred affinity is mandatory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes