Skip to content
Latchkey

helm upgrade: Deploy Chart Changes in CI

Upgrade an existing release (or install it if missing) to a new chart or values.

helm upgrade applies a new chart version or values to a release. With --install it creates the release on first run, making it the idempotent workhorse of CI deploys. --atomic rolls back automatically if the upgrade fails, which keeps clusters in a known-good state. Latchkey managed runners run these helm steps with cluster credentials injected per job.

Common flags

  • --install - install if the release does not exist
  • -n NAMESPACE --create-namespace - target/create namespace
  • -f values.yaml / --set key=value - values overrides
  • --atomic --wait --timeout=DURATION - auto-rollback on failure

Example in CI

Idempotently deploy a new image tag with auto-rollback.

shell
helm upgrade --install api ./charts/api \
  -n prod --create-namespace \
  -f values.prod.yaml \
  --set image.tag=${GITHUB_SHA} \
  --atomic --wait --timeout 300s

Common errors in CI

  • UPGRADE FAILED: another operation ... is in progress - a prior release is stuck pending
  • UPGRADE FAILED: ... timed out waiting for the condition - resources never became ready (--atomic rolls back)
  • Error: ... has no deployed releases - release in failed state; needs repair or --install

Key takeaways

  • The idempotent CI deploy command via helm upgrade --install.
  • Use --atomic so a failed upgrade auto-rolls-back to the last good release.
  • A stuck pending release blocks future upgrades until resolved.

Related guides

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