Run one step, then check it
Read the step before copying. Bash commands belong in Git Bash on Windows or Azure Cloud Shell set to Bash; PowerShell uses different syntax. A JSON, YAML, Bicep or application-code example belongs in the named file, not directly at the terminal prompt. Follow any shell-specific instructions below.
Keep the same terminal open so earlier variables remain available. Copy one complete command block without the terminal's $ prompt. A backslash continues a command onto the next line. If Bash shows a lone >, it is waiting for the rest of a quote, command or file block. Finish the complete block; if the paste was incomplete, press Ctrl+C and copy it again. Do not paste the next step into an unfinished command.
A line such as RG="training-group" stores a value without printing it. Output captured with $(...) is also stored; a blank screen alone does not prove failure. A sleep deliberately waits, and -o none suppresses normal output. Wait for your normal prompt, then run the step's checkpoint. After an error, stop and keep the exact command and message; later steps cannot repair a missing resource. Never share passwords, access tokens or secret values in a screenshot.
A release is a named, numbered thing you can undo
Helm packages Kubernetes manifests as a chart. Installing it creates a named release with numbered revisions. An upgrade adds a revision; a rollback applies an earlier retained revision's Helm-managed manifests and values as a new revision. This lab checks that a replica-count change reaches the cluster and that rollback restores it. In a real incident, also test the application: Helm cannot reverse changes to data or systems outside its release.
Undo, as a single line with a number in it.
You need a free Azure account and the Azure CLI (az), signed in with az login. First time? The 15-minute Set up your machine page covers the account, the installs, and sign-in. Prefer zero installs? Run everything in Azure Cloud Shell (Bash) — az, kubectl, and helm are all preinstalled and already signed in.
This lab uses the cluster from Your first AKS cluster or creates one if it is gone. AKS nodes and related resources can incur charges; a ClusterIP Service avoids adding a public load balancer for this release. Check your subscription's pricing and delete the dedicated lab resource group when done. Do not delete a group shared with other work.
The cluster
If you still have the cluster from Your first AKS cluster, skip to Step 2. Otherwise recreate it with the identical command.
# Windows/Git Bash: stop it mangling /subscriptions/... arguments (harmless on macOS/Linux) export MSYS_NO_PATHCONV=1 RG="campux-lab-aks-rg" az group create -n "$RG" -l eastus # same command as the first-cluster lab: free control plane, one small node # if Azure says this size "is not allowed in your subscription", the same error lists the sizes # that are; pick a 2-vCPU one from that list (Standard_D2as_v4 worked for us in October 2026) az aks create -n campux-aks -g "$RG" \ --tier free \ --node-count 1 \ --node-vm-size Standard_D2as_v4 \ --enable-managed-identity \ --generate-ssh-keys az aks get-credentials -n campux-aks -g "$RG" helm version --short
helm version --short prints an installed version. Run kubectl get nodes and wait for the lab node to report Ready before installing the chart.Add a chart repo, install a release
podinfo is a small, well-known demo chart built for exactly this kind of exercise — a real Deployment and Service with values worth changing. Install it as a release named shop-release, starting deliberately small.
Commands inside $(...) save their output in a variable. Check the printed identifier or the checkpoint before continuing.
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm repo update
kubectl create namespace helmdemo
# Choose one published chart version and keep it for both changes.
helm search repo podinfo/podinfo --versions | head
CHART_VERSION="$(helm search repo podinfo/podinfo --versions -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)[0]["version"])')"
echo "$CHART_VERSION"
helm install shop-release podinfo/podinfo \
--namespace helmdemo \
--version "$CHART_VERSION" --wait --timeout 5m \
--set replicaCount=1
helm list -n helmdemo
helm list -n helmdemo shows shop-release, STATUS: deployed, REVISION: 1. That revision number is the whole point of everything that follows — it is what helm rollback will target.The release is one thing, not a pile of files
Confirm the pod is real and reachable, then look at the release the way Helm sees it — as a single named, versioned object, not as "whatever is currently in the namespace."
This block includes a deliberate wait. Leave this terminal open until the normal prompt returns; a wait is not proof that access has propagated.
kubectl rollout status deployment/shop-release-podinfo -n helmdemo --timeout=5m
kubectl get pods -n helmdemo
kubectl get deploy,svc -n helmdemo
# fullname template = release name + chart name, since "shop-release" does not already contain "podinfo"
kubectl port-forward -n helmdemo svc/shop-release-podinfo 9898:9898 &
sleep 2
curl -s localhost:9898/ | head -c 200
echo
kill %1
helm status shop-release -n helmdemo
curl returns a response from the running pod, and helm status reports revision 1 as deployed. The release groups its managed Deployment and Service under one name.Upgrade with a changed value, watch the rollout land
Ship a real change — triple the replica count — and watch Kubernetes actually create the new pods before you check anything with Helm.
helm upgrade shop-release podinfo/podinfo \ --namespace helmdemo \ --version "$CHART_VERSION" --wait --timeout 5m \ --set replicaCount=3 kubectl rollout status deployment/shop-release-podinfo -n helmdemo --timeout=5m kubectl get pods -n helmdemo
helm status shop-release -n helmdemo helm history shop-release -n helmdemo
helm status shows REVISION: 2. helm history lists two rows — revision 1 (install) and revision 2 (upgrade), both deployed/superseded appropriately. The upgrade did not overwrite revision 1's record; it added a new one on top of it, which is exactly what makes the next step possible.Roll back to revision one — then prove it, do not just trust it
One command, one number. Do not stop at "the command exited zero" — check the pod count and the values Helm actually stored, the same way you would in an incident at three in the morning.
helm rollback shop-release 1 -n helmdemo --wait --timeout 5m kubectl rollout status deployment/shop-release-podinfo -n helmdemo --timeout=5m kubectl get pods -n helmdemo
helm history shop-release -n helmdemo helm get values shop-release -n helmdemo
helm history now lists three revisions — the rollback did not erase revision 2's history, it added revision 3, whose description reads Rollback to 1. helm get values shows replicaCount: 1, matching revision 1's values exactly. Three revisions on record, one pod running, one value reverted — that is proof, not a claim.The rollback created revision 3 from retained revision 1. This exercise changed only Helm-managed resources. History can be limited or pruned, so an old revision may no longer be available. A production rollback also needs health checks and a plan for any data or external-system changes.
Tear it down
helm uninstall removes resources managed by this release, subject to retention policies. Then remove this lab's namespace and dedicated resource group. Confirm the group contains no unrelated work first.
helm uninstall shop-release -n helmdemo
kubectl delete namespace helmdemo
az group delete -n campux-lab-aks-rg --yes --no-wait
az group exists -n campux-lab-aks-rg # -> false once complete
helm list -n helmdemo returns nothing before the namespace is even gone — the release is deleted. Confirm the resource group and its auto-managed node group (named like MC_campux-lab-aks-rg_campux-aks_eastus) are both gone.What you can now honestly claim
You installed a pinned chart version as a named release, upgraded its replica count, and restored a retained revision. You verified the Deployment became ready and checked Helm's stored values. That is evidence for this lab's replica-count rollback; a production recovery also needs application and data checks.