Bird
0
0

You see a Pod stuck in Pending state. You check kubectl describe pod and find the message: 0/2 nodes are available: 2 node(s) didn't match Pod's node selector.

medium📝 Troubleshoot Q14 of 15
Kubernetes - Troubleshooting
You see a Pod stuck in Pending state. You check kubectl describe pod and find the message: 0/2 nodes are available: 2 node(s) didn't match Pod's node selector.
What should you do to fix this?
ADelete the Pod and recreate it without changes.
BIncrease the Pod's CPU requests to match node capacity.
CRemove or correct the Pod's nodeSelector labels to match available nodes.
DRestart the Kubernetes cluster.
Step-by-Step Solution
Solution:
  1. Step 1: Understand nodeSelector impact

    The Pod's nodeSelector restricts scheduling to nodes with matching labels.
  2. Step 2: Fix nodeSelector to match nodes

    Adjust or remove nodeSelector so nodes in cluster match Pod requirements.
  3. Final Answer:

    Remove or correct the Pod's nodeSelector labels to match available nodes. -> Option C
  4. Quick Check:

    nodeSelector mismatch = fix labels [OK]
Quick Trick: Check and fix nodeSelector labels to match nodes [OK]
Common Mistakes:
  • Increasing CPU requests worsens scheduling
  • Deleting Pod without fixing selector won't help
  • Restarting cluster is unnecessary

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes