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
# tear down a preview environment
helmfile -e "pr-$PR_NUMBER" destroy
# remove only one labeled group
helmfile destroy --selector app=apiOptions
| Flag | What it does |
|---|---|
| -e, --environment <name> | Select the environment to destroy |
| --selector key=value | Destroy only matching releases |
| --skip-charts | Skip 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.