Chapter 85: Helm for Kubernetes
85.4 Install, upgrade, rollback, uninstall
Story. Meera at an Infosys-style account in Pune installed hello-web into namespace lab. She changed replicas from 2 to 3, upgraded, then rolled back when the new tag 404'd. Helm kept revision history so rollback was one command — not a Git archaeology session at 11 pm.
Why
kubectl apply does not remember last week's YAML. Helm stores release secrets or configmaps with history so you can move forward and back.
What
- helm install — Create a release.
- helm upgrade --install — Create or update (safe default in CI).
- helm rollback — Go back to a revision.
- helm uninstall — Remove the release and its objects.
- revision — A numbered snapshot of that release.
How — Example 1: First install
kubectl create namespace lab
helm install hello hello-web -n lab
helm list -n lab
Output
NAME NAMESPACE REVISION STATUS CHART APP VERSION
hello lab 1 deployed hello-web-0.1.0 1.0.0
What it shows: Release name is hello. Chart name is hello-web. Revision 1.
Example 2: Upgrade values
helm upgrade hello hello-web -n lab --set replicaCount=3
helm history hello -n lab
Output
REVISION STATUS CHART DESCRIPTION
1 superseded hello-web-0.1.0 Install complete
2 deployed hello-web-0.1.0 Upgrade complete
What it shows: Revision 2 is live; 1 is superseded.
Example 3: Rollback
helm rollback hello 1 -n lab
Output
Rollback was a success! Happy Helming!
What it shows: Cluster objects go back to revision 1's rendered YAML.
Example 4: Uninstall
helm uninstall hello -n lab
Output
release "hello" uninstalled
Ravindra Bagale's Tip
In CI prefer helm upgrade --install so the same job works for the first deploy and every later one.
CI मध्ये helm upgrade --install वापरा — पहिल्या आणि पुढच्या deploy साठी एकच job.
CI में helm upgrade --install इस्तेमाल करें — पहली और बाद की deploy के लिए एक ही job.
Quick quiz
Q1. What does helm upgrade --install do?
Creates the release if missing, otherwise upgrades it.
Q2. How do you go back to revision 1?
helm rollback RELEASE 1 -n NAMESPACE
Q3. Does uninstall remove the chart files on disk?
No. It removes the release from the cluster.
Did you understand? Let us try it once more.