Skip to content
Latchkey

helmfile destroy: Uninstall All Releases

helmfile destroy runs helm uninstall for every release in the helmfile, tearing the whole stack down.

For ephemeral preview environments, destroy is the cleanup step: it removes every release the helmfile created.

What it does

helmfile destroy uninstalls all releases defined in the current helmfile (honoring the selected environment and any selector). It is the inverse of sync. It does not delete the namespace itself unless a release managed it.

Common usage

Terminal
# tear down a preview environment
helmfile -e "pr-$PR_NUMBER" destroy
# remove only one labeled group
helmfile destroy --selector app=api

Options

FlagWhat it does
-e, --environment <name>Select the environment to destroy
--selector key=valueDestroy only matching releases
--skip-chartsSkip the chart prepare/build phase

In CI

Run destroy in a cleanup job when a pull request closes so preview namespaces do not accumulate. Use the same -e environment name you deployed with so destroy targets exactly that stack. destroy is safe to re-run: missing releases are skipped.

Common errors in CI

"Error: uninstall: Release not loaded: ...: release: not found" on a release that was never installed is benign and helmfile generally continues. If destroy leaves PVCs or CRDs behind, that is expected: helm does not delete PVCs from StatefulSets or CRDs by default. A stuck namespace usually has a finalizer on a leftover resource.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →