Q: Deployment has 0 ready pods but desired is 3.
All pods failing readiness. Check probe config and app logs.
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.
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 prodshows READY 0/3, UP-TO-DATE and AVAILABLE.UP-TO-DATE 0suggests the ReplicaSet could not create pods;UP-TO-DATE 3withAVAILABLE 0suggests 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
FailedCreateevents there, not on pods. - Pods present: read STATUS:
Pending(scheduling),ContainerCreating(image, volume or CNI),ImagePullBackOff,CrashLoopBackOff, orRunningwith 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.
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=.lastTimestampoften 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,
--previousis essential because the current container may have no output yet. - Quick filter:
kubectl get pods -n prod -l app=my-appgrouped 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.
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 podgives 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
startupProbeprevents slow starters from failing early. - No pods created: ResourceQuota, LimitRange, admission webhook denial, or Pod Security Admission
restrictedrejecting the spec.
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 prodrestores the previous ReplicaSet quickly while you investigate. - Wait for convergence:
kubectl rollout status deploy/my-app -n prod --timeout=180sexits 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-appshould 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.
Prevention and Alerting
Make the next failure visible before users report it.
- Progress deadline: the default
progressDeadlineSecondsis 600, after which the Deployment gets aProgressDeadlineExceededcondition. Tune it to your startup time. - CI gate: run
kubectl rollout statusafter deploy and fail the pipeline if it times out, triggering an automatic undo. - Alerts: with kube-state-metrics, alert on
kube_deployment_status_replicas_availablebeing belowkube_deployment_spec_replicasfor several minutes. - Dry run:
kubectl apply --dry-run=serversurfaces quota and admission rejections before the real rollout.
- 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.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Reading only pod logs when no pods exist Quota or admission failures are reported on the ReplicaSet, so pod logs will never show them.
- Restarting or deleting pods repeatedly It destroys the evidence in events and previous logs and does not change the underlying cause.
- Forgetting --previous on crash loops The current container is freshly restarted and often shows nothing, while the crash output is in the prior instance.
- 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.