Skip to content
LatchkeyLatchkey home

helm uninstall: Usage, Options & Common CI Errors

Remove a release and everything it created.

helm uninstall deletes a release and the Kubernetes objects it manages. In CI it tears down preview environments and test releases - where idempotency on re-run matters.

What it does

helm uninstall NAME removes the release's resources and its release record. --keep-history retains the revision history (so the release can be rolled back / reinstalled), while the default purges it. --wait blocks until the resources are actually deleted. It does not delete the namespace.

Common usage

Terminal
helm uninstall web -n prod
helm uninstall web --keep-history
helm uninstall web --wait --timeout 2m
helm uninstall web --ignore-not-found        # idempotent in CI

Common errors in CI

"Error: uninstall: Release not loaded: web: release: not found" is the re-run failure - the release was already removed. Use --ignore-not-found so teardown is idempotent. uninstall does not remove the namespace or any PersistentVolumeClaims the chart's StatefulSets created (those are retained by design), so a "clean" environment can keep growing PVCs; delete the namespace explicitly if you need a full wipe. With --keep-history the release name stays reserved, so a later helm install of the same name can hit "cannot re-use a name". Use upgrade --install instead.

Using this in CI

A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.

Terminal
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods

# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info

# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodes

Frequently asked questions

helm uninstall: Usage, Options & Common CI Errors?
helm uninstall deletes a release and the Kubernetes objects it manages. In CI it tears down preview environments and test releases - where idempotency on re-run matters.
What it does?
helm uninstall NAME removes the release's resources and its release record. --keep-history retains the revision history (so the release can be rolled back / reinstalled), while the default purges it. --wait blocks until the resources are actually deleted. It does not delete the namespace.
Common errors in CI?
"Error: uninstall: Release not loaded: web: release: not found" is the re-run failure - the release was already removed. Use --ignore-not-found so teardown is idempotent. uninstall does not remove the namespace or any PersistentVolumeClaims the chart's StatefulSets created (those are retained by design), so a "clean" environment can keep

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card