Helm Charts
Package, template, and release Kubernetes apps with Helm — the K8s package manager.
Helm is the package manager for Kubernetes. A chart bundles templated
manifests plus a values.yaml of defaults. Installing a chart creates a
release you can upgrade and roll back, instead of hand-applying many YAMLs.
The power is templating: manifests use Go templates filled from values, so one
chart deploys to dev/staging/prod with different --values. Public charts on
Artifact Hub install common software (databases, ingress) in one command.
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-db bitnami/postgresql -f prod-values.yaml
helm upgrade my-db bitnami/postgresql --set auth.database=app
helm rollback my-db 1 # revert to revision 1
helm list # show releases# templates/deployment.yaml (excerpt)
spec:
replicas: {{ .Values.replicaCount }}
template:
spec:
containers:
- image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" - Install a public chart and override one value with
--set. - Explain the role of
values.yamland how environments differ. - Upgrade a release, then roll it back to a prior revision.
- Describe what a Helm “release” is.
Cheat Sheet▾
| Task | Command |
|---|---|
| Add repo | helm repo add name url |
| Install | helm install rel chart |
| Values file | -f values.yaml |
| Inline override | --set key=value |
| Upgrade | helm upgrade rel chart |
| Roll back | helm rollback rel N |
| List releases | helm list |
Common Interview Questions▾
What is a Helm chart?
A package of templated Kubernetes manifests plus default values. Installing it creates a release you can upgrade and roll back, rather than applying many raw YAMLs.
How does one chart serve multiple environments?
Through templating and values: the same chart is installed with different values files or —set overrides, so dev/staging/prod differ only by their inputs.