From 19d1dfde360db59072ce631c8b870d86622eec14 Mon Sep 17 00:00:00 2001 From: leaddevops <36464863+leaddevops@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:02:27 +0530 Subject: [PATCH] uninstall --- .../04-uninstall-helm-charts.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 04-work-with-helm-charts/04-uninstall-helm-charts.md diff --git a/04-work-with-helm-charts/04-uninstall-helm-charts.md b/04-work-with-helm-charts/04-uninstall-helm-charts.md new file mode 100644 index 0000000..69dd11b --- /dev/null +++ b/04-work-with-helm-charts/04-uninstall-helm-charts.md @@ -0,0 +1,89 @@ +## Helm Uninstall + +## add repo & install a chart +```t +# add & Search Helm Repo + + helm repo add lerndevops https://lerndevops.github.io/helm-charts/ + helm search repo lerndevops/nginxdemo + +# install a chart from repo + helm install sampleapp lerndevops/sampleapp + helm install mynginx lerndevops/nginxdemo +``` +## uninstall Helm Relase - NO FLAGS +```t +# List Helm Releases + helm ls + +# Uninstall Helm Release + helm uninstall + helm uninstall mynginx + helm uninstall sampleapp +``` + +## Uninstall Helm Release with --keep-history Flag +```t +# install, upgrade & rollback a Helm Chart + helm install mynginx lerndevops/nginxdemo --version 0.1 + helm upgrade mynginx lerndevops/nginxdemo --version 0.2 + helm upgrade mynginx lerndevops/nginxdemo --version 0.3 + helm rollback mynginx + +# List Helm Releases + helm list + hlem list -f mynginx + helm list -f mynginx --superseded + helm list -f mynginx --deployed + +# List Release History + helm history mynginx + +# Uninstall Helm Release with --keep-history Flag + helm uninstall --keep-history + helm uninstall mynginx --keep-history + +# List Helm Releases which are uninstalled + helm list -f mynginx + helm list -f mynginx --uninstalled + +Note: We should see uninstalled release + +# helm status command + helm status mynginx + +Note: +1. works only when we use --keep-history flag +2. We can see all the details of release with "Status: Uninstalled" +``` + +## Rollback Uninstalled Release +```t +# List Release History + helm history mynginx + +# Rollback Helm Uninstalled Release + helm rollback [REVISION] [flags] + helm rollback mynginx 3 + +Note: It should rollback to specific revision number from revision history + +# List Helm Releases + helm list + +# List Kubernetes Resources + kubectl get pods + kubectl get svc + +# List Kubernetes Resources Deployed as part of this Helm Release + helm status mynginx --show-resources + +# Access Application + http://localhost:31232 +``` + +## Best Practice for Helm Uninstall + +> **It is recommended to always use `--keep-history Flag` for following reasons** + - Keeping Track of uninstalled releases + - Quick Rollback if that Release is required \ No newline at end of file