Bird
0
0

You want to ensure your Deployment always has 3 pods running. You set replicas: 3 but sometimes kubectl get pods shows only 2 running pods. What should you do to fix this?

hard📝 Workflow Q15 of 15
Kubernetes - ReplicaSets and Deployments
You want to ensure your Deployment always has 3 pods running. You set replicas: 3 but sometimes kubectl get pods shows only 2 running pods. What should you do to fix this?
ACheck pod events and logs to find why one pod is not running and fix the issue
BIncrease replicas to 4 to force Kubernetes to create more pods
CDelete the Deployment and recreate it with replicas set to 3
DIgnore it; actual replicas will eventually match desired without intervention
Step-by-Step Solution
Solution:
  1. Step 1: Investigate why pods are missing

    Check pod events and logs to identify issues like crashes, scheduling failures, or resource limits causing pods not to run.
  2. Step 2: Fix the root cause

    Resolve the identified problem (e.g., fix image, increase resources) so Kubernetes can maintain 3 running pods as desired.
  3. Final Answer:

    Check pod events and logs to find why one pod is not running and fix the issue -> Option A
  4. Quick Check:

    Fix pod issues to match actual to desired replicas [OK]
Quick Trick: Always check pod status and logs if replicas don't match [OK]
Common Mistakes:
  • Scaling replicas blindly without fixing pod issues
  • Deleting Deployment unnecessarily
  • Assuming Kubernetes fixes pod issues automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes