⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Kubernetes Interview Questions Scenario 83 of 207 in Kubernetes
Senior DevOps / SRE [L2] Kubernetes Advanced Scenarios Production Scenario [L2]
🎯 Target Role / Context: Kubernetes Scenario #72 (L2) · Advanced Scenarios

Q: Deployment has 0 ready pods but desired is 3.

All pods failing readiness. Check probe config and app logs.

#Kubernetes #Advanced Scenarios #L2 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
"When a <strong>Deployment has 0 ready pods but desired is 3</strong>, find which stage the pods are stuck in: not created, not scheduled, not started, or started but failing the readiness probe. Work from the Deployment down to the ReplicaSet, then the Pod, then its events and logs. Interviewers use this scenario to see whether you triage in a repeatable order instead of guessing, and whether you know that READY counts only pods whose readiness probe passes, not pods that merely exist."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: When a <strong>Deployment has 0 ready pods but desired is 3</strong>, find which stage the pods are stuck in: not created, not scheduled, not started, or started but failing the readiness probe. Work from the Deployment down to the ReplicaSet, then the Pod, then its events and logs. Interviewers use this scenario to see whether you triage in a repeatable order instead of guessing, and whether you know that READY counts only pods whose readiness probe passes, not pods that merely exist.

1️⃣

Symptom and Triage Order

Classify the failure before touching anything: the pod count and phase tell you where to look.

  • Start at the top: kubectl get deploy my-app -n prod shows READY 0/3, UP-TO-DATE and AVAILABLE. UP-TO-DATE 0 suggests the ReplicaSet could not create pods; UP-TO-DATE 3 with AVAILABLE 0 suggests pods exist but are not ready.
  • No pods at all: look at the ReplicaSet. Quota exceeded, a rejecting admission webhook, a Pod Security violation or a missing ServiceAccount all surface as FailedCreate events there, not on pods.
  • Pods present: read STATUS: Pending (scheduling), ContainerCreating (image, volume or CNI), ImagePullBackOff, CrashLoopBackOff, or Running with READY 0/1 (probe failing).
  • Read the counts correctly: READY compares ready pods to desired; UP-TO-DATE counts pods on the newest ReplicaSet; AVAILABLE counts pods ready for at least minReadySeconds. The three numbers together identify the stage.
2️⃣

Hands-on: Deployment 0 Ready Pods, Ordered Checks

Run the same sequence every time. Each command answers one question and narrows the next.

kubectl get deploy,rs,pods -n prod -l app=my-app -o wide
kubectl describe deploy my-app -n prod | sed -n '/Conditions/,/Events/p'
kubectl describe rs -n prod -l app=my-app | tail -20      # FailedCreate shows here
kubectl describe pod -n prod -l app=my-app | grep -A15 Events
kubectl logs deploy/my-app -n prod --previous --tail=50
kubectl get events -n prod --sort-by=.lastTimestamp | tail -20
  • Events first: kubectl get events -n prod --sort-by=.lastTimestamp often names the cause in one line, such as insufficient CPU or a failed mount.
  • Describe the pod: the Conditions block (PodScheduled, Initialized, ContainersReady, Ready) tells you the first stage that is False.
  • Logs of the previous run: for a crash loop, --previous is essential because the current container may have no output yet.
  • Quick filter: kubectl get pods -n prod -l app=my-app grouped by STATUS tells you immediately whether all three pods fail the same way, which suggests a configuration or image problem, or differently, which suggests node or capacity problems.
Advertisement
3️⃣

Root Causes Mapped to Symptoms

Most cases fall into a short list, each with a distinct signature.

  • Pending, unschedulable: event 0/N nodes are available: Insufficient cpu, untolerated taints, unbound PVC, or node selector mismatch. Fix requests, add capacity, correct tolerations or the storage class.
  • ImagePullBackOff: wrong tag, private registry without imagePullSecrets, or rate limiting. kubectl describe pod gives the exact registry error. Pulling the wrong tag or a registry outage looks identical across all three replicas, which is the clue that the problem is shared rather than node-specific.
  • CrashLoopBackOff: application exits at start: missing env var, bad config, unreachable dependency, or OOMKilled (check lastState.terminated.reason).
  • Running but 0/1 Ready: readiness probe wrong path or port, app slow to start, or dependency down. A startupProbe prevents slow starters from failing early.
  • No pods created: ResourceQuota, LimitRange, admission webhook denial, or Pod Security Admission restricted rejecting the spec.
4️⃣

Fix, Verify and Roll Back Safely

Apply the narrowest fix, then prove recovery with the rollout status rather than by eye.

# Is the probe the problem? Compare the probe config with what the app serves
kubectl get deploy my-app -n prod -o jsonpath='{.spec.template.spec.containers[0].readinessProbe}'
kubectl get pod -n prod -l app=my-app -o jsonpath='{range .items[*]}{.metadata.name}{"  "}{.status.containerStatuses[0].lastState.terminated.reason}{"\n"}{end}'
# Expected for an OOM crash: OOMKilled
  • Fix forward or revert: if the last change caused it, kubectl rollout undo deploy/my-app -n prod restores the previous ReplicaSet quickly while you investigate.
  • Wait for convergence: kubectl rollout status deploy/my-app -n prod --timeout=180s exits non-zero on failure, which makes it usable in scripts. Prefer a fix that changes the manifest in Git, because a manual kubectl edit during an incident is easily overwritten by the next pipeline run.
  • Confirm traffic: kubectl get endpointslices -n prod -l kubernetes.io/service-name=my-app should list ready addresses; an empty list means the Service still has no backends.
  • Probe debugging: run the probe by hand: kubectl exec deploy/my-app -n prod -- wget -qO- localhost:8080/healthz. A different response from the one the kubelet expects means the probe path, port or scheme is wrong.
5️⃣

Prevention and Alerting

Make the next failure visible before users report it.

  • Progress deadline: the default progressDeadlineSeconds is 600, after which the Deployment gets a ProgressDeadlineExceeded condition. Tune it to your startup time.
  • CI gate: run kubectl rollout status after deploy and fail the pipeline if it times out, triggering an automatic undo.
  • Alerts: with kube-state-metrics, alert on kube_deployment_status_replicas_available being below kube_deployment_spec_replicas for several minutes.
  • Dry run: kubectl apply --dry-run=server surfaces quota and admission rejections before the real rollout.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: The ReplicaSet is where FailedCreate events live, so when a Deployment shows no pods, describe the ReplicaSet before hunting through pod logs that do not exist."
⚡ 60-Second Elevator Pitch Talking Points
  • READY 0 of 3 means no pod passes its readiness probe, so I locate the stage: not created, not scheduled, not started, or unready.
  • I go Deployment, ReplicaSet, Pod, events, then logs with --previous, and read the first failing condition.
  • I confirm with rollout status and EndpointSlices, and prevent repeats with a CI gate, progress deadline and kube-state-metrics alerts.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Reading only pod logs when no pods exist Quota or admission failures are reported on the ReplicaSet, so pod logs will never show them.
  2. Restarting or deleting pods repeatedly It destroys the evidence in events and previous logs and does not change the underlying cause.
  3. Forgetting --previous on crash loops The current container is freshly restarted and often shows nothing, while the crash output is in the prior instance.
  4. Treating a failing readiness probe as an application crash The pod can be healthy but probing the wrong port or path, so the fix is probe configuration, not code.
Advertisement
📥 FREE DOWNLOAD · 101-PAGE COMPANION HANDBOOK
Studying for Kubernetes & SRE Technical Rounds?
Download the complete 100-question PDF field guide covering all 11 core modules with offline diagnostic runbooks.
📥 Download PDF (Free) Read Online Guide →
Want more Kubernetes scenarios?
Explore our complete collection of scenario-based Kubernetes interview runbooks.
Browse All Kubernetes Questions →