Helm delete all releases
I'm trying find a way to delete all deployed releases in Helm.
It appears that Helm does not support deleting all releases, with --all
or otherwise.
Would there be another way to delete all Helm releases in one command?
Solution 1:
To delete all Helm releases in Linux(in Helm v2.X) with a single command, you can use some good old bash. Just pipe the output of helm ls --short
to xargs
, and run helm delete
for each release returned.
helm ls --all --short | xargs -L1 helm delete
Adding --purge
will delete the charts as well, as per @Yeasin Ar Rahman's comment.
helm ls --all --short | xargs -L1 helm delete --purge
On Windows, you can delete all releases with this command, again, with --purge
deleting the charts as well.
helm del $(helm ls --all --short) --purge
Solution 2:
For helm 3 you have to provide namespaces so there is an awk
step before xargs
:
helm ls -a --all-namespaces | awk 'NR > 1 { print "-n "$2, $1}' | xargs -L1 helm delete
This results in commands like:
helm delete -n my-namespace my-release
Solution 3:
This worked for me in a powershell cmd window:
helm del $(helm ls --all --short) --purge
Solution 4:
helm delete $(helm ls --short)
Description:
helm ls --short
gives a list of releases ids.
helm delete id1 id2 id3
deletes releases with ids: id1
, id2
, id3
.
So combining them we get:
helm delete $(helm ls --short)