Skip to content
Latchkey

helmfile "context deadline exceeded" in CI

A helm operation launched by helmfile exceeded its timeout: either the API server was unreachable from the runner, or --wait waited past the deadline for resources to become ready. The message names the deadline, not the deeper cause.

What this error means

helmfile apply or sync fails with "Error: context deadline exceeded" or "Kubernetes cluster unreachable: ... context deadline exceeded" while contacting the cluster.

helmfile
Error: context deadline exceeded
in ./helmfile.yaml: command "helm" exited with non-zero status

Common causes

The API server is unreachable from the runner

A missing or wrong KUBECONFIG, a private endpoint, or a network hop that the runner cannot reach makes every request time out.

A release with --wait never became ready

helm waited for pods or hooks that stayed unready past the timeout, so the operation hit its deadline.

How to fix it

Confirm cluster connectivity and KUBECONFIG

  1. Verify KUBECONFIG points at a reachable context from the runner.
  2. Run kubectl get ns to confirm the API server responds.
  3. Check that the runner has a network route to a private endpoint.
Terminal
export KUBECONFIG=$PWD/kubeconfig
kubectl cluster-info
helmfile apply

Raise the timeout for slow rollouts

Give helm more time to wait for readiness when the deadline, not connectivity, is the issue.

Terminal
helmfile apply --wait --timeout 600

How to prevent it

  • Export a valid KUBECONFIG before any helmfile command.
  • Set realistic --timeout values for releases that use --wait.
  • Ensure runners can route to the cluster API endpoint.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →