Lab Guide
Time estimate: 30–45 minutes · Prerequisites: Helm installed, a running Kubernetes cluster (minikube, kind, or Docker Desktop)
Setup
This lab walks you through creating your first Helm chart, exploring its structure, deploying it to a cluster, and managing the full release lifecycle. You will use a local Kubernetes cluster throughout.
Before You Begin
Verify your environment is ready:
# Confirm Helm is installed
helm version
# Confirm kubectl can reach your cluster
kubectl cluster-info
# Confirm you have a namespace to work in
kubectl get namespaces
If kubectl cluster-info fails, start your local cluster first (e.g., minikube start or kind create cluster).
Exercise 1: Scaffold and Explore a Chart
Goal
Create a new Helm chart with helm create and understand every file in the generated structure.
Steps
- Create a working directory and scaffold a chart:
mkdir -p ~/helm-labs/lesson02 && cd ~/helm-labs/lesson02 helm create myapp - List the generated files:
find myapp -type f | sortExpected output:
myapp/.helmignore myapp/Chart.yaml myapp/charts myapp/templates/NOTES.txt myapp/templates/_helpers.tpl myapp/templates/deployment.yaml myapp/templates/hpa.yaml myapp/templates/ingress.yaml myapp/templates/service.yaml myapp/templates/serviceaccount.yaml myapp/templates/tests/test-connection.yaml myapp/values.yaml - Examine
Chart.yaml:cat myapp/Chart.yamlExpected output (key fields):
apiVersion: v2 name: myapp description: A Helm chart for Kubernetes type: application version: 0.1.0 appVersion: "1.16.0" - Examine the default values:
cat myapp/values.yamlNote the nested structure:
image.repository,image.tag,service.type,service.port, etc. - Look at the helper templates:
cat myapp/templates/_helpers.tplIdentify the named templates:
myapp.name,myapp.fullname,myapp.labels, andmyapp.selectorLabels. - Preview the rendered output without installing:
helm template my-release myappThis renders all templates with default values and prints the resulting Kubernetes YAML to stdout. Verify that the Deployment uses
nginxas the image and the Service is typeClusterIP.
Self-check: You can identify the purpose of every file in the chart directory and the rendered output contains valid Kubernetes manifests.
Exercise 2: Install, Inspect, and Upgrade
Goal
Deploy the chart to your cluster, inspect the release, and perform an upgrade with modified values.
Steps
- Install the chart as a release named
my-release:helm install my-release myappExpected output (excerpt):
NAME: my-release LAST DEPLOYED: ... NAMESPACE: default STATUS: deployed REVISION: 1 NOTES: 1. Get the application URL by running these commands: export POD_NAME=$(kubectl get pods ... echo "Visit http://127.0.0.1:8080 ..." kubectl --namespace default port-forward $POD_NAME 8080:80 - List all releases:
helm listExpected output:
NAME NAMESPACE REVISION ... STATUS CHART APP VERSION my-release default 1 deployed myapp-0.1.0 1.16.0 - Get detailed status:
helm status my-release - Verify the Kubernetes resources were created:
kubectl get deployment,service,pod -l app.kubernetes.io/instance=my-release - Upgrade the release to 3 replicas:
helm upgrade my-release myapp --set replicaCount=3Expected output (excerpt):
Release "my-release" has been upgraded. Happy Helming! ... REVISION: 2 - Verify the upgrade:
# Check revision history helm history my-release # Confirm 3 pods are running kubectl get pods -l app.kubernetes.io/instance=my-releaseExpected:
helm historyshows 2 revisions.kubectl get podsshows 3 pods. - Retrieve the values used for the current revision:
helm get values my-releaseExpected output:
USER-SUPPLIED VALUES: replicaCount: 3
Self-check: helm list shows revision 2, and 3 pods are running in the cluster.
Exercise 3: Rollback and Uninstall
Goal
Roll back to the original revision and then clean up by uninstalling the release.
Steps
- Roll back to revision 1 (1 replica):
helm rollback my-release 1Expected output:
Rollback was a success! Happy Helming! - Verify the rollback created a new revision:
helm history my-releaseExpected output:
REVISION ... STATUS ... DESCRIPTION 1 superseded Install complete 2 superseded Upgrade complete 3 deployed Rollback to 1Notice revision 3 was created, not revision 1 restored. History is never rewritten.
- Confirm only 1 pod is running again:
kubectl get pods -l app.kubernetes.io/instance=my-release - View the rendered manifests for the current revision:
helm get manifest my-release | head -40 - Uninstall the release:
helm uninstall my-releaseExpected output:
release "my-release" uninstalled - Confirm everything is cleaned up:
# No releases listed helm list # No resources remain kubectl get deployment,service,pod -l app.kubernetes.io/instance=my-releaseExpected: Empty results for both commands.
Self-check: helm list returns no results. No Kubernetes resources remain from the release.
Clean Up
You can remove the lab directory when finished:
rm -rf ~/helm-labs/lesson02/myapp
Or keep it around for the homework exercises.