Helm
A real application is a dozen manifests (Deployment, Service, Ingress, ConfigMap, HPA, ServiceAccount, …) that differ slightly between environments. Helm is the package manager for Kubernetes: it bundles templated manifests into a chart, fills them with values, and tracks each installation as a release that can be upgraded and rolled back.
| Term | Meaning |
|---|---|
| Chart | A package: templates + default values.yaml + metadata (Chart.yaml) |
| Values | The configuration you pass in (-f my-values.yaml, --set image.tag=2.3.1) |
| Release | One installed instance of a chart in a namespace, with a revision history |
| Repository | Where charts are published (an HTTP index or an OCI registry) |
Using public charts
Prefer charts published by the project that makes the software. Many now ship them to an OCI registry, so you install straight from a reference with no helm repo add step. cert-manager, which you will meet again for TLS, is a good example:
CHART=oci://quay.io/jetstack/charts/cert-manager
helm show chart $CHART --version v1.21.3 # metadata: maintainers, sources, appVersion
helm show values $CHART --version v1.21.3 > cm-values.yaml # see what you can configure
helm install cert-manager $CHART --version v1.21.3 \
-n cert-manager --create-namespace --set crds.enabled=true
helm list -n cert-manager
helm upgrade cert-manager $CHART --version v1.21.3 -n cert-manager --reuse-values --set replicaCount=2
helm history cert-manager -n cert-manager
helm rollback cert-manager 1 -n cert-manager
helm uninstall cert-manager -n cert-managerSample output of helm list:
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
cert-manager cert-manager 2 2026-10-02 10:14:07.412339 +0000 UTC deployed cert-manager-v1.21.3 v1.21.3Classic HTTP chart repositories still work the same way as before: helm repo add <name> <url>, helm repo update, helm search repo <name>, then helm install <release> <name>/<chart>. helm search repo only searches repositories you added; it doesn't search OCI registries.
Is this chart maintained?
A chart is a dependency like any other, and it pins container images you will run for years. From August 2025 Bitnami, whose charts appeared in a huge number of tutorials, stopped publishing its free Debian-based images: existing tags moved to a bitnamilegacy repository that gets no updates, versioned production images moved to the paid Bitnami Secure Images offering, and only a small free set remains (the latest tag, meant for development). Clusters that had copied helm install bitnami/... from a blog post suddenly had images that no longer pulled, or kept running ones that would never be patched. Before adopting a chart, check:
- Who publishes it. The upstream project (cert-manager, Traefik, Argo CD, Prometheus community) or a third-party packager?
helm show chartlistsmaintainers,homeandsources. - Is it alive? Recent releases, an active source repository, and no "deprecated" or "legacy" notice in its README or on Artifact Hub.
- Which images it runs, and whether those are maintained too. Render the chart and look:
helm template cm oci://quay.io/jetstack/charts/cert-manager --version v1.21.3 | grep 'image:' | sort -u image: "quay.io/jetstack/cert-manager-cainjector:v1.21.3"
image: "quay.io/jetstack/cert-manager-controller:v1.21.3"
image: "quay.io/jetstack/cert-manager-startupapicheck:v1.21.3"
image: "quay.io/jetstack/cert-manager-webhook:v1.21.3"For your own services, write your own chart (next section) and push it to your registry; you then control both the chart and the images.
Chart structure
shop-api/
├── Chart.yaml # name, version (of the chart), appVersion (of the app)
├── values.yaml # defaults
├── templates/
│ ├── _helpers.tpl # reusable named templates
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ └── NOTES.txt # printed after install
└── charts/ # dependencies (subcharts)# values.yaml
replicaCount: 2
image:
repository: ghcr.io/acme/api
tag: "2.3.1"
service:
port: 80
ingress:
enabled: false
host: shop.example.com# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-api
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicaCount }}
template:
spec:
containers:
- name: api
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"Templates use Go's template language: {{ .Values.x }} inserts a value, {{ if }}/{{ range }} control structure, and pipes like | quote, | default, | indent 4 transform values.
Values precedence
Values are deep-merged from several sources, later ones winning: chart values.yaml < each -f file in order < --set flags. This model performs that merge and renders a tiny template:
import re
import yaml
def deep_merge(base, override):
out = dict(base)
for k, v in override.items():
out[k] = deep_merge(out[k], v) if isinstance(v, dict) and isinstance(out.get(k), dict) else v
return out
def set_flag(values, expr): # --set image.tag=2.4.0
path, value = expr.split("=", 1)
keys = path.split(".")
node = values
for k in keys[:-1]:
node = node.setdefault(k, {})
node[keys[-1]] = int(value) if value.isdigit() else value
return values
chart_defaults = yaml.safe_load("""
replicaCount: 2
image: {repository: ghcr.io/acme/api, tag: "2.3.1"}
resources: {requests: {cpu: 100m}}
""")
prod_file = yaml.safe_load("""
replicaCount: 5
resources: {requests: {memory: 256Mi}}
""")
values = deep_merge(chart_defaults, prod_file)
values = set_flag(values, "image.tag=2.4.0")
print(yaml.safe_dump(values, sort_keys=True).strip())
template = "replicas: {{ .Values.replicaCount }}\nimage: {{ .Values.image.repository }}:{{ .Values.image.tag }}"
def lookup(match):
node = {"Values": values}
for part in match[1].strip(" .").split("."):
node = node[part]
return str(node)
print("--- rendered ---")
print(re.sub(r"\{\{\s*([^}]+?)\s*\}\}", lookup, template))image:
repository: ghcr.io/acme/api
tag: 2.4.0
replicaCount: 5
resources:
requests:
cpu: 100m
memory: 256Mi
--- rendered ---
replicas: 5
image: ghcr.io/acme/api:2.4.0
Notice that resources.requests kept cpu from the chart and gained memory from the file: maps merge key by key, while scalars (and lists!) are replaced wholesale.
Seeing what Helm will do
Templates can produce surprising YAML. Render locally before installing:
helm template shop-api ./shop-api -f values-prod.yaml # print the manifests
helm lint ./shop-api
helm upgrade --install shop-api ./shop-api -f values-prod.yaml --dry-run=server
helm diff upgrade shop-api ./shop-api -f values-prod.yaml # with the helm-diff pluginReleases and revisions
Helm stores each release revision as a Secret in the release's namespace (sh.helm.release.v1.<name>.v<revision>). helm rollback re-applies the manifests of an older revision as a new revision, much like a Deployment rollback:
history = []
def record(action, chart, values_note):
for h in history:
if h["status"] == "deployed":
h["status"] = "superseded"
history.append({"rev": len(history) + 1, "status": "deployed", "chart": chart, "desc": f"{action}: {values_note}"})
record("Install complete", "shop-api-1.0.0", "tag 2.3.1")
record("Upgrade complete", "shop-api-1.1.0", "tag 2.4.0")
record("Upgrade complete", "shop-api-1.1.0", "tag 2.4.1")
target = history[1]
record(f"Rollback to {target['rev']}", target["chart"], "tag 2.4.0")
print(f"{'REVISION':9}{'STATUS':12}{'CHART':16}DESCRIPTION")
for h in history:
print(f"{h['rev']:<9}{h['status']:12}{h['chart']:16}{h['desc']}")REVISION STATUS CHART DESCRIPTION
1 superseded shop-api-1.0.0 Install complete: tag 2.3.1
2 superseded shop-api-1.1.0 Upgrade complete: tag 2.4.0
3 superseded shop-api-1.1.0 Upgrade complete: tag 2.4.1
4 deployed shop-api-1.1.0 Rollback to 2: tag 2.4.0
Tip: Pin chart versions (
--version v1.21.3) and keep your values files in Git. Never edit resources managed by Helm withkubectl edit: the nexthelm upgradeoverwrites your change. Charts are also commonly installed by GitOps tools (Argo CD, Flux), covered later.
Test yourself
What is a Helm release?
- A chart version on a repository
- One installed instance of a chart in a cluster, with revisions
- A Docker image tag
- A Git tag
Which value wins: chart default replicaCount: 2, -f prod.yaml with 5, and --set replicaCount=3?
- 2
- 5
- 3
- Helm errors
How can you see the exact manifests a chart will produce without touching the cluster?
- helm install --force
- helm template
- helm rollback
- kubectl get all