Deleting namespace and remove release

1/15/2020

I wonder the purpose of adding clean up stage in Jenkins CI/CD pipeline to remove release if exist with helm delete command. What is the main purpose ans use case that we need to clean up the environment that we would like to deploy? Is that still necessary for using upgrade install command for helm.

helm upgrade --install a-service
-- semural
kubernetes
kubernetes-helm

1 Answer

1/15/2020

When you do helm delete $RELEASE_NAME it deletes all resources but keeps the record with $RELEASE_NAME in case you want to rollback. You can see removed releases via helm ls -a . Whereas helm delete --purge $RELEASE_NAME removes records and make that name free to be reused for another installation.

If your initial release ends up in a failed state then running helm upgrade --install a-service will throw error

$ helm upgrade "foo" . --install 
Error: UPGRADE FAILED: "foo" has no deployed releases

Then you need clean it up using

helm delete foo --purge
-- Arghya Sadhu
Source: StackOverflow