Skip to content

Helm: not ready – context deadline exceeded after --wait

Helmtested on Helm v4.3.2

With --wait, Helm watches the rollout and gives up after --timeout. "context deadline exceeded" only means: Helm waited, the resource did not become ready. Why is not in Helm's message but in the Pods and their events.

Symptom

time helm upgrade h ./helper -n tag13 --set image.tag=0.0.0-gibtsnicht \
  --wait --timeout 30s
Error: UPGRADE FAILED: resource Deployment/tag13/h-helper not ready. status: InProgress,
message: Pending termination: 1
context deadline exceeded
real    0m31.067s

The revision is failed afterwards. Without --wait, Helm would have reported the same upgrade as deployed after one second – with an image that doesn't exist.

Diagnosis

Look at the release's status, the Pods, the events and the values that were set.

helm status c -n tag19 | grep -E '^STATUS'
kubectl -n tag19 get pods -l app.kubernetes.io/instance=c
kubectl -n tag19 describe pod -l app.kubernetes.io/instance=c | grep -m1 'statuscode'
helm get values c -n tag19
STATUS: failed
NAME                        READY   STATUS    RESTARTS   AGE
c-helper-7bd5bf5496-rbsm2   0/1     Running   0          31s
  Warning  Unhealthy  8s (x5 over 30s)  kubelet  spec.containers{helper}: Readiness
probe failed: HTTP probe failed with statuscode: 503
USER-SUPPLIED VALUES:
probePath: /status/503

Causes

ErrImagePullImage can't be pulled

The new Pod is stuck in ErrImagePull, the Deployment never finishes.

kubectl -n tag13 get pods
NAME                        READY   STATUS         RESTARTS   AGE
h-helper-5498ffdf68-vpm78   0/1     ErrImagePull   0          9s
h-helper-79c5cc98c4-4c75f   0/1     Running        0          11s

Readiness probe failedThe Pod runs but never becomes ready

The readinessProbe asks for a path that doesn't return 200. In the course the cause is in get values, the proof in the events.

Hook jobA hook job hangs

Helm only creates normal objects after the pre-install hooks. If the hook needs a Secret from the chart, it waits in vain.

Error: INSTALLATION FAILED: failed pre-install: resource Job/tag11/h1-vorher not ready.
status: InProgress, message: Job in progress
context deadline exceeded
NAME              READY   STATUS                       RESTARTS   AGE
h1-vorher-qfhrg   0/1     CreateContainerConfigError   0          31s

PVC PendingThe volume isn't bound

A PVC stays Pending. kubectl get pvc and the PVC's events show the reason.

Fix

Fix the cause, then roll out again with --wait. If the error came from a value that was set, --reset-values discards it – an upgrade without values would have carried it over from the failed revision.
helm upgrade c ./helper -n tag19 --reset-values --wait --timeout 60s | grep REVISION
helm history c -n tag19 -o json | jq -r '.[] | "\(.revision) \(.status)"'
REVISION: 2
1 superseded
2 deployed

Don't: Taking the message for the cause. "context deadline exceeded" only means that Helm waited – the answer is in the Pods and their events.

▶
Break it yourself and find it – free
Helm Charts hands-on, day 13: rolling out safely – upgrade --install, wait strategies, automatic rollback and what a rollback doesn't bring back.
Go to day 13 →

FAQ

Why does Helm report success without --wait?

Without --wait an upgrade counts as successful as soon as the API has accepted the objects. Only hooks are waited for.

Does --rollback-on-failure help?

Only if every deployment ran with waiting. Otherwise the rollback targets a revision that slipped through as deployed, broken, without --wait.

Why is --wait happy although the Service delivers nothing?

Without a readinessProbe a Pod is ready as soon as the process runs. Helm is only as good as the probes in the chart.

Related error patterns

More