Skip to content
Latchkey

helm uninstall: Command Reference for CI/CD

Remove a release and the resources it created.

helm uninstall deletes a release and the objects Helm installed for it. In CI it tears down per-PR preview environments. This reference covers the flags that control history retention and blocking behaviour.

Common flags and usage

  • uninstall <release>: delete the release and its resources
  • --namespace <ns>: scope to the release namespace
  • --keep-history: retain release history for later inspection
  • --wait: block until resources are fully removed
  • --ignore-not-found: do not error if the release is absent (idempotent)

Example

shell
helm uninstall web-pr-${PR_NUMBER} \
  --namespace previews --ignore-not-found --wait

In CI

Use --ignore-not-found so a teardown job is idempotent and does not fail when the release was already removed. --wait ensures resources are gone before the step returns, which matters if you then delete the namespace. uninstall does not remove a namespace it did not create.

Key takeaways

  • --ignore-not-found keeps teardown jobs idempotent.
  • --wait blocks until resources are actually gone.
  • uninstall does not delete a namespace it did not create.

Related guides

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