kubectl: error: timed out waiting for the condition
The wait command only reports that a condition never became true. Read pod events, probes and scheduling, fix the cause, then wait again.

Introduction & Quick Summary
A deploy pipeline stops on a line that says nothing about the app:
error: timed out waiting for the condition
It comes from kubectl wait, kubectl rollout status, helm upgrade --wait or a CI step wrapped around one of them. Quick answer: the condition the command was waiting for never became true within the timeout, so the command gave up. The timeout is not the problem; the workload never reached the requested state.
kubectl wait --for=condition=available deployment/api --timeout=300s
kubectl rollout status deployment/api --timeout=300s
kubectl get deploy api -o wide
kubectl describe deploy api | sed -n '/Conditions/,$p'Read the workload before raising the timeout. A Deployment that reports Available=False with MinimumReplicasUnavailable is usually waiting on a readiness probe, a missing image, an unschedulable pod or a quota. This guide covers what each wait command actually checks, how to find the blocking condition in seconds, and how to write a CI step that fails with evidence instead of a bare timeout.
Core Mechanics, Signatures & Reproducible Setup
kubectl wait polls a resource's .status.conditions array and returns when a condition with the requested type has status: "True". --for=delete and --for=jsonpath=... are the other supported forms.
kubectl wait --for=condition=Ready pod/api-7d9f-abc --timeout=120s
kubectl wait --for=delete pod/api-7d9f-abc --timeout=120s
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' svc/api --timeout=180sReproduce locally with kind:
kind create cluster --name wait-demo
kubectl create deployment api --image=nginx:1.27 --replicas=2
kubectl set env deployment/api BREAK=1
kubectl patch deployment api -p '{"spec":{"template":{"spec":{"containers":[{"name":"nginx","readinessProbe":{"httpGet":{"path":"/healthz","port":80},"initialDelaySeconds":5,"periodSeconds":5}}]}}}}'
kubectl wait --for=condition=available deployment/api --timeout=60s
# error: timed out waiting for the conditionThe Deployment never reports Available=True because /healthz returns 404, so the pods never become Ready, so availableReplicas stays at 0.
| Command | Watches | Fails fast on |
|---|---|---|
kubectl wait --for=condition=Available deploy/x | Deployment conditions | timeout only |
kubectl rollout status deploy/x | rollout progress, prints "Waiting for ..." | ProgressDeadlineExceeded |
helm upgrade --wait | all resources in the release | timeout or failed hook |
kubectl wait --for=condition=Ready pod/x | pod readiness | timeout only |
kubectl wait --for=condition=Complete job/x | job completion | timeout only |
kubectl wait --for=jsonpath='{.status.phase}'=Running pod/x | any status field | timeout only |
| Resource | Useful condition | Meaning when False |
|---|---|---|
| Deployment | Available | fewer than minimum replicas ready |
| Deployment | Progressing | ProgressDeadlineExceeded, rollout stalled |
| Pod | Ready | readiness probe failing or container not started |
| Pod | ContainersReady | one or more containers unready |
| Job | Complete | still running, or Failed |
| PersistentVolumeClaim | status.phase=Bound | no matching PV or StorageClass |
| Custom resource | whatever the operator defines | read the CRD's printer columns |
Key Comparison Table
| What you see | Root cause | First command |
|---|---|---|
Available=False MinimumReplicasUnavailable | pods not Ready | kubectl get pods -o wide |
Progressing=False ProgressDeadlineExceeded | rollout stalled past deadline | kubectl describe deploy events |
Pods Pending | unschedulable: CPU, memory, taints, PVC | kubectl describe pod last line |
Pods ImagePullBackOff | wrong tag, private registry auth | kubectl describe pod events |
Pods CrashLoopBackOff | container exits during start | kubectl logs --previous |
0/2 ready with restarts 0 | readiness probe path or port wrong | kubectl exec -- curl localhost:PORT/healthz |
PVC Pending | no StorageClass, no PV, wrong access mode | kubectl describe pvc |
| Service with no endpoints | selector mismatch | kubectl get endpoints svc/x |
| Wait flag | Correct use | Common mistake |
|---|---|---|
--timeout=300s | explicit duration | writing --timeout=300 which means 300 seconds but reads as nanoseconds in some older docs |
--timeout=0 | wait forever, default is 30s | using it in CI and hanging the job |
-n prod | target namespace | forgetting it and waiting in default |
--all | every object of that type | waiting on unrelated broken resources |
--for=condition=Ready | exact type name, case sensitive | ready or Available on a Pod |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
1. Deployment Available never becomes true
kubectl get deploy api -o jsonpath='{.status.conditions[*].type}={.status.conditions[*].status}{"\n"}'
kubectl get pods -l app=api -o wide
kubectl describe pod -l app=api | tail -25Three causes cover most cases: the image cannot be pulled, the pod cannot be scheduled, or the readiness probe fails. The probe case is the quiet one, because the container is running and the logs look healthy while READY 0/1 never changes.
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3Check the port the app really listens on, and whether /healthz answers before the app finishes loading. A probe that hits a path behind authentication always returns 401 and never passes.
2. rollout status versus wait
kubectl rollout status understands the rollout state machine and prints progress; it exits non-zero when the Deployment reports ProgressDeadlineExceeded, which is often earlier than your timeout. kubectl wait only sees the condition and the clock.
kubectl rollout status deploy/api --timeout=300s
# Waiting for deployment "api" rollout to finish: 0 of 2 updated replicas are available...
# error: deployment "api" exceeded its progress deadlineIn CI, prefer rollout status for Deployments and wait for objects without a rollout concept.
3. PVC binding
kubectl get pvc data -o jsonpath='{.status.phase}{"\n"}'
kubectl describe pvc data | tail -15Pending with WaitForFirstConsumer is normal until a pod schedules; with Immediate it means no PV satisfies the request. Access mode mismatches and a missing storageClassName also keep it Pending, and a stateful workload then waits forever on its own condition.
4. Jobs and custom resources
kubectl wait --for=condition=Complete job/migrate --timeout=600s
kubectl get job migrate -o yaml | yq '.status'A Job whose pod is stuck in ImagePullBackOff never completes, and backoffLimit only applies to failed runs, not to unschedulable ones. For operators, check kubectl get crd <name> -o jsonpath='{.status.conditions}' and the operator logs; a CR whose condition stays Unknown usually means the controller is not running.
5. Timeout and context traps
# waits in the wrong namespace and times out for the wrong reason
kubectl wait --for=condition=available deploy/api --timeout=120s
# correct
kubectl wait --for=condition=available deploy/api -n prod --timeout=120skubectl wait requires the resource to exist. If the manifest was never applied, the command fails with not found rather than a timeout, which is a useful distinction when reading CI logs. --for=jsonpath needs Kubernetes 1.23 or newer and a value that compares as a string.
6. Make CI fail with evidence
if ! kubectl rollout status deploy/api --timeout=300s; then
kubectl get pods -o wide
kubectl describe deploy api | tail -30
kubectl get events --sort-by=.lastTimestamp | tail -25
exit 1
fiThis turns a one-line timeout into the pod state, the events and the condition that blocked the rollout. kubectl get events --field-selector involvedObject.name=api narrows it further. Use the YAML formatter to validate the manifest before applying, and the JSON formatter when reading -o json output in a script.
Common Compilation/Runtime Mistakes & Version Gotchas
- Raising the timeout first. A condition that is never going to be true will not become true in ten minutes either; the extra time only delays the failure.
- Waiting on the Deployment when the pod is the problem.
Availableis a summary. The pod'sReadycondition and events carry the reason. - Wrong condition name.
Readyfor pods,AvailableandProgressingfor Deployments,Completefor Jobs; names are case-sensitive and an unknown type simply never matches. - Namespace drift. A missing
-nwaits indefault, finds nothing or finds a stale object, and times out. --allin shared clusters. It waits on resources other teams own and turns their incident into your failed build.- Helm
--waitwithout--timeout. The default is 5 minutes, and a rollout that legitimately takes longer fails the release and can trigger a rollback. - Version differences.
kubectl waitgained--for=jsonpathand--for=createover several releases; clusters older than 1.23 reject those flags. Helm 3.14 changed how failed hooks interact with--wait, so pin the Helm version in CI. ProgressDeadlineExceededis sticky. Once a Deployment reports it, a later successful rollout clears it, but a Deployment left in that state keeps reporting it until the spec changes; restarting pods by hand does not reset the condition.
The reliable pattern is: wait on the most specific condition that represents user-visible readiness, print the pod state and events when the wait fails, and fix the underlying scheduling, probe or image problem that keeps the condition false.
Official documentation: kubectl wait and Deployments.
Official references
primary documentationThe Kubernetes documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit Kubernetes work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Kubernetes guides
All Kubernetes guidesKubernetes 1.35: kubelet will not start on a cgroup v1 node
A 1.35 kubelet refuses a cgroup v1 host, and the removed pod-infra flag stops custom images. Check the kernel command line before the node pool.
Kubernetes: x509 certificate has expired or is not yet valid
kubeadm control plane certificates last one year. Renew them, restart the static pods, refresh kubeconfigs, and alert before the next expiry.
kubectl: metadata.resourceVersion: Invalid value: 0x0
The 0x0 error means an update carried no resourceVersion. Switch to apply or patch, or read the live object first, and keep versions out of Git.
no matches for kind in version: removed APIs and missing CRDs
kubectl cannot map the manifest to an endpoint. Either the API version was removed or the CRD is absent, and discovery tells you which.
More in Kubernetes
All Kubernetes guidesThe guides filed next to this one in Kubernetes, in library order.