You applied a Deployment YAML but no pods are created. Which issue is most likely causing this?
medium📝 Troubleshoot Q14 of 15
Kubernetes - ReplicaSets and Deployments
You applied a Deployment YAML but no pods are created. Which issue is most likely causing this?
AThe Deployment metadata name is missing
BThe Deployment selector labels do not match the pod template labels
CThe replicas field is set to zero
DThe container image name is missing
Step-by-Step Solution
Solution:
Step 1: Understand Deployment selector importance
The Deployment uses the selector to find pods it manages. If selector labels don't match pod template labels, no pods are created.
Step 2: Evaluate other options
Missing image name causes pod creation failure but usually with errors. Replicas zero means no pods but is explicit. Missing metadata name causes YAML validation error.
Final Answer:
The Deployment selector labels do not match the pod template labels -> Option B
Quick Check:
Selector-template label mismatch = no pods [OK]
Quick Trick:Check selector and template labels match exactly [OK]
Common Mistakes:
Ignoring label mismatch
Assuming missing image silently creates no pods
Confusing replicas zero with label mismatch
Master "ReplicaSets and Deployments" in Kubernetes
9 interactive learning modes - each teaches the same concept differently