Kubernetes: Helm in One Lesson
Helm is the package manager for Kubernetes. It turns a pile of YAML files into one chart you can install, upgrade and roll back.
Install a chart
One command installs the whole app. The release name marks this install.
helm install web ./web-chartChange a value
Values change the install without editing the templates. The upgrade swaps in the new setting.
helm upgrade web ./web-chart --set web.replicas=3List the releases
The release list shows each install and its revision. Revision numbers track every change.
helm listRoll back a bad upgrade
Rollback returns to the earlier revision. The app goes back to the settings that worked.
helm rollback web 1Example
helm install web ./web-chart
helm list
helm upgrade web ./web-chart --set web.replicas=3
helm listKey points
- Helm: a package manager that installs apps on Kubernetes from charts
- Chart: a Helm package that holds the templates and default values for one app
- Values: the settings file that fills in the chart templates for one install
- Use helm install to deploy a chart as a named release
- Use helm upgrade to change a release to new values or a new chart version
- Use helm rollback to return a release to an earlier revision
- Use helm list to see the releases running on the cluster
In this example, the first command installs the chart as the release named web. The second command lists the releases. The third command upgrades the release to three web replicas. The fourth command lists the releases again. The output shows the revision rising from 1 to 2, so the upgrade took effect.
Note
A chart is a template, so one chart can install the same app many times with different values.
Try it Yourself
Edit the code, then press Run.
Running is simulated · Rust Playground
Exercise
What does helm rollback do?