Bird
0
0

Why can't nodeSelector be used to express complex scheduling rules like excluding nodes with certain labels?

hard📝 Conceptual Q10 of 15
Kubernetes - Scheduling
Why can't nodeSelector be used to express complex scheduling rules like excluding nodes with certain labels?
ABecause nodeSelector requires nodes to have all labels in the cluster.
BBecause nodeSelector only supports exact label matching, not operators like 'NotIn'.
CBecause nodeSelector only works with taints and tolerations.
DBecause nodeSelector is deprecated and replaced by node affinity.
Step-by-Step Solution
Solution:
  1. Step 1: Understand nodeSelector capabilities

    nodeSelector matches nodes by exact label key-value pairs only.
  2. Step 2: Recognize limitation for complex rules

    It cannot express operators like 'NotIn' or exclude labels; node affinity is needed.
  3. Final Answer:

    Because nodeSelector only supports exact label matching, not operators like 'NotIn'. -> Option B
  4. Quick Check:

    nodeSelector = exact match only; complex rules need node affinity [OK]
Quick Trick: nodeSelector matches exact labels; use affinity for complex rules [OK]
Common Mistakes:
  • Thinking nodeSelector works with taints
  • Believing nodeSelector is deprecated
  • Assuming nodeSelector can exclude nodes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes