Bird
0
0

Why is it important that the spec.selector field in a Deployment YAML exactly matches the labels in spec.template.metadata.labels?

hard📝 Conceptual Q10 of 15
Kubernetes - ReplicaSets and Deployments
Why is it important that the spec.selector field in a Deployment YAML exactly matches the labels in spec.template.metadata.labels?
ABecause the Deployment uses the selector to identify and manage its pods.
BBecause Kubernetes uses the selector to assign IP addresses to pods.
CBecause the selector controls the pod resource limits.
DBecause the selector defines the node where pods run.
Step-by-Step Solution
Solution:
  1. Step 1: Understand selector purpose

    The selector tells the Deployment which pods it should manage by matching labels.
  2. Step 2: Clarify incorrect options

    Selector does not assign IPs, control resource limits, or define node placement.
  3. Final Answer:

    Because the Deployment uses the selector to identify and manage its pods. -> Option A
  4. Quick Check:

    Selector matches pods for management [OK]
Quick Trick: Selector matches pods to Deployment for control [OK]
Common Mistakes:
  • Thinking selector assigns IPs
  • Confusing selector with resource limits
  • Assuming selector controls pod scheduling

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes