Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm is not showing releases / Can't delete old releases

I am using helm v3.0.0-alpha.2 on Kubernetes v1.15.3.

[root@somebox log]# helm version
version.BuildInfo{Version:"v3.0.0-alpha.2", GitCommit:"97e7461e41455e58d89b4d7d192fed5352001d44", GitTreeState:"clean", GoVersion:"go1.12.7"}

helm list shows no releases.

[root@somebox log]# helm list
NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART

Yet I cannot install a new release and give it a name because it is 'still in use'. It was a release at some point, but should no longer exist.

[root@somebox log]# helm install --namespace rook-ceph rook-ceph-acme rook-release/rook-ceph
Error: cannot re-use a name that is still in use

How can I clear out old releases that are not showing up with helm list?

Thanks.

like image 575
David West Avatar asked Aug 27 '19 20:08

David West


People also ask

How do I force delete Helm release?

If you need to uninstall the deployed release, run the delete command on the Helm command line. The command removes all the Kubernetes components that are associated with the chart and deletes the release.

How do I delete all Helm releases?

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. Adding --purge will delete the charts as well, as per @Yeasin Ar Rahman's comment.

How do I remove a Helm release from Kubernetes?

To remove the pods, list the pods with kubectl get pods and then delete the pods by name. To delete the Helm release, find the Helm release name with helm list and delete it with helm delete .


1 Answers

First, you have to list the releases with the namespace assigned to it. Second, you have to purge all the releases in helm2; it will automatically purge in helm3

helm2

helm del <release-name> --namespace <namespace>
helm del $(helm ls --all | grep 'DELETED' | awk '{print $1}') --purge

helm3

helm3 del <release-name> --namespace <namespace>

# list and delete the release
helm3 del -n rook-ceph $(helm3 ls -n rook-ceph | grep 'rook-ceph' | awk '{print $1}')

More details: https://devopsqa.wordpress.com/2020/01/29/helm-cli-cheatsheet/

like image 120
Prashanth Sams Avatar answered Sep 28 '22 15:09

Prashanth Sams