Helm is the package manager for Kubernetes. It bundles a set of manifests into a versioned, configurable chart, installs it as a named release and keeps a history of every change so you can upgrade and roll back. You will use it for two things: installing other people’s software and, optionally, packaging your own.
Three words to know
| Term | Meaning |
|---|---|
| Chart | A package: templates, default values and metadata |
| Release | One installed copy of a chart, with a name and a revision history |
| Repository | A place where charts are published and downloaded from |
One chart can be installed many times in the same cluster, each time as a different release with its own values and history.
Why use Helm?
For third-party software, Helm is the obvious choice. Prometheus, Grafana, cert-manager, Argo CD and most other cluster tools ship as charts. One command replaces hundreds of lines of YAML:
$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
$ helm repo update
$ helm install monitoring prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace
For your own apps, it is a trade-off. One chart can serve every environment through different values files. In exchange you write Go templates, and they become hard to read as conditionals and helpers pile up.
Helm 3 removed the old pain
Helm 2 needed an in-cluster component called Tiller with broad permissions, and it was a well-known security problem. Helm 3 removed it entirely. Helm now runs only on your machine and uses your kubeconfig, so it can do exactly what you can do and no more.
Each release’s state is stored as Secrets in the release’s namespace. That is why helm list only shows the current namespace and helm list -A shows all of them.
The everyday workflow
Here is the full cycle with the small podinfo demo chart:
$ helm repo add podinfo https://stefanprodan.github.io/podinfo
$ helm search repo podinfo
NAME CHART VERSION APP VERSION DESCRIPTION
podinfo/podinfo 6.9.2 6.9.2 Podinfo Helm chart for Kubernetes
$ helm show values podinfo/podinfo > values.yaml
Edit values.yaml to change only what you need:
replicaCount: 2
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 128Mi
Install, inspect, change, undo and remove:
$ helm install demo podinfo/podinfo -f values.yaml
NAME: demo
STATUS: deployed
REVISION: 1
$ helm list
NAME NAMESPACE REVISION STATUS CHART APP VERSION
demo default 1 deployed podinfo-6.9.2 6.9.2
$ helm upgrade demo podinfo/podinfo -f values.yaml --set replicaCount=3 --atomic --timeout 5m
$ helm history demo
REVISION STATUS CHART DESCRIPTION
1 superseded podinfo-6.9.2 Install complete
2 deployed podinfo-6.9.2 Upgrade complete
$ helm rollback demo 1
Rollback was a success! Happy Helming!
$ helm uninstall demo
release "demo" uninstalled
Two habits worth building:
- Read the default values before installing with
helm show values. Chart defaults are made to start easily, not for production. Look for resources, replica counts and persistence. - Make upgrades atomic with
--atomicand a--timeout. If the upgrade fails, Helm rolls back automatically instead of leaving a half-upgraded release. Helm 4 renamed the flag to--rollback-on-failureand still accepts--atomicas a deprecated alias.
What happens during an upgrade
Helm does a three-way merge between the manifest of the previous release, the new manifest and the live objects. Two practical consequences:
- Changes made by hand with
kubectl editmay survive an upgrade or may be overwritten, depending on the field. Decide whether Helm or humans own an object, not both. - If a resource disappears from the chart, Helm deletes it on upgrade, because it tracks what it created.
Preview an upgrade before you run it. The helm-diff plugin is the single most useful Helm add-on:
$ helm plugin install https://github.com/databus23/helm-diff
$ helm diff upgrade demo podinfo/podinfo -f values.yaml
default, demo-podinfo, Deployment (apps) has changed:
- replicas: 2
+ replicas: 3
Where Helm is weak
- CRDs: CustomResourceDefinitions placed in a chart’s
crds/folder are installed once and then never upgraded or deleted by Helm. Apply new CRD versions yourself before upgrading, following the chart’s release notes. - Readability: deeply nested templates and
_helpers.tplfiles are hard to follow.helm templaterenders the final YAML so you can see what will really be applied. - Rollbacks are partial:
helm rollbackrestores Kubernetes objects only. It does not undo database migrations or bring back data from a deleted volume.
Helm or Kustomize?
| Helm | Kustomize | |
|---|---|---|
| Approach | Templates with variables | Patches on plain YAML |
| Readability | Gets harder as charts grow | Base files stay valid YAML |
| Distribution | Versioned packages in repositories | No packaging |
| Release tracking | Built in, with rollback | None, relies on Git |
| Built into kubectl | No | Yes: kubectl apply -k |
| Ecosystem | Almost every tool ships a chart | Mostly used for your own manifests |
A sensible default: Helm for third-party software, Kustomize for your own manifests. GitOps tools such as Argo CD and Flux support both, even Kustomize patches on top of a rendered chart.
Quick reference
| Task | Command |
|---|---|
| Add a repository | helm repo add <name> <url> |
| Search | helm search repo <term> |
| See the settings | helm show values <chart> |
| Install | helm install <release> <chart> -f values.yaml |
| Install or upgrade | helm upgrade --install <release> <chart> -f values.yaml --atomic |
| All releases | helm list -A |
| History | helm history <release> |
| Roll back | helm rollback <release> <revision> |
| Render without installing | helm template <release> <chart> -f values.yaml |
| Remove | helm uninstall <release> |
Exercise
Where does Helm 3 keep the history of a release?
Show answer
Answer: B. Each revision is stored as a Secret next to the release. That is why helm list is per namespace, and why a teammate on another machine sees the same history.
Exercise
You want to see the final YAML a chart would produce with your values, without installing anything. Which command do you use?
Show answer
Answer: D. helm template renders the chart locally with your values and prints the manifests. It is the quickest way to understand what complex templates really generate.
Key takeaways
- A chart is the package, a release is an installed copy of it.
- Helm 3 has no Tiller and acts with your own kubeconfig permissions.
- Read
helm show valuesbefore installing anything. - Upgrade with
--atomicand a timeout; preview withhelm diff. - Helm never upgrades CRDs from the
crds/folder. helm rollbackrestores objects, not data or migrations.- Helm for third-party software, Kustomize for your own manifests, is a solid default.
FAQ
Do I need Helm?
To install third-party tools, practically yes, since that is how they are distributed. For your own applications it is optional: plain manifests or Kustomize are often easier to read.
What is the difference between a chart and a release?
A chart is the package you download. A release is one installation of it in a cluster, with its own name, values and revision history.
How do I roll back a release?
Find the revision with helm history <release> and run helm rollback <release> <revision>. It only restores Kubernetes objects, so plan database changes separately.
Is Helm safe in production? What happened to Tiller?
Yes. Tiller existed only in Helm 2. Helm 3 and later run entirely client-side with your own permissions. Any guide that mentions helm init or Tiller is describing Helm 2.