How to delete or uninstall specific helm chart resource ?
This tutorial guides you on how to delete or uninstall specific helm chart resource. To demonstrate this let’s first install a sample helm chart resource and later delete it.
Create/ Install a Helm Chart resource
Let’s use the GitHub sample Hello Helm for our exercise.
First, download the git hub code in your local directory or on your machine as shown below.
$ git clone https://github.com/cloudnativedevops/demo.git Cloning into 'demo'... remote: Enumerating objects: 885, done. remote: Total 885 (delta 0), reused 0 (delta 0), pack-reused 885 Receiving objects: 100% (885/885), 330.78 KiB | 13.78 MiB/s, done. Resolving deltas: 100% (363/363), done.
Verify, whether the Helm Chart deployment YAML files are there of the demo application in the following path /demo/hello-helm/k8s/demo as shown below.
~/demo/hello-helm/k8s/demo (sneppets)$ ls Chart.yaml production-values.yaml staging-values.yaml templates values.yaml
The subdirectory /k8s/demo contains the Kubernetes manifest files to deploy the demo application. Let’s deploy by running the following command.
$ helm install demo /home/sneppets/demo/hello-helm/k8s/demo/ NAME: demo LAST DEPLOYED: Mon Apr 5 11:11:56 2021 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None
Verify the resources after deployment is successful.
$ helm ls NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION demo default 1 2021-04-05 11:11:56.345206926 +0000 UTC deployed demo-1.0.1
Now, let’s see how to delete specific helm chart resource in the next section.
Delete or uninstall specific helm chart resource
To delete or uninstall specific helm chart resource you need to run the following command.
$ helm delete demo release "demo" uninstalled
Verify whether the resources are deleted.
$ helm ls NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
Note, if you wanted to keep the record/track of the releases even after uninstallation, you need to use the flag –keep-history as shown below. Don’t forget to check the status “uninstalled“.
$ helm delete demo --keep-history release "demo" uninstalled $ helm ls -a NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION demo default 1 2021-04-05 11:19:59.395317133 +0000 UTC uninstalled demo-1.0.1
Note, if you try to install with the same name then you will get the following error. This is because of –keep-history flag used when the resource was deleted.
$ helm install demo /home/nithip/demo/hello-helm/k8s/demo/ Error: cannot re-use a name that is still in use
Alternatively you can use “uninstall” instead of “delete” because the command helm delete has been renamed to helm uninstall.
$ helm uninstall demo release "demo" uninstalled $ helm ls NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
That’s it you had learnt how to create a Helm Chart resource and also tried deleting specific helm chart resource using delete and uninstall commands.
Hope it helped 🙂
You’ll also like:
- Google cloud shell command to get the default PROJECT_ID – GCP
- Docker EXPOSE Port only to the Host on Google Cloud
- Get Docker Container’s IP Address from the Host
- Copy Files between Host and Docker Container
- What is ImagePullBackOff status on a Kubernetes pod ?
- Set or change root password in Ubuntu Linux
- How to list all Containers running in Kubernetes Pod ?
- How to find which users belongs to a specific group in linux
- Give write permissions for specific user or group for specific folder in linux
- How to remove an image tag from docker hub ?
- Build a Docker Image with a Dockerfile and Cloud Build in GCP?
- How to create GCP project on Google Cloud Platform
- no matches for kind “Deployment” in version “extensions/v1beta1”
- Create GCP project on Google Cloud Platform
- Is it possible to change Google Cloud Platform Project ID ?
- Purpose of –purge flag in helm delete command
- Make manual payment or pay early for your Google Cloud Platform charges
- Open specific port such as 8082 in Google Compute Engine
- Delete or unset clusters contexts and users entries from kubectl config