Helm: Packages for Kubernetes
In short: A package manager for Kubernetes that bundles many related YAML files as a “chart” and installs them with adjustable values.
In more detail: An application on Kubernetes often consists of many resources: deployment, service, config map, ingress and more. Helm combines them into a chart. With helm install the chart is deployed, and values such as image version or number of replicas can be adjusted easily.
In Depth
Terms
- Chart: package with templates and default values (
values.yaml). - Release: an installed instance of a chart with a name.
- Repository: collection of published charts (for example for databases or monitoring).
- Values: settings that fill in the templates.
Typical commands
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-db bitnami/postgresql --set auth.postgresPassword=secret
helm upgrade my-db bitnami/postgresql -f my-values.yaml
helm rollback my-db 1
helm uninstall my-db
upgrade changes an existing release, rollback restores an earlier version. In real operation passwords do not belong on the command line.
Templates
Templates use the Go template language. An excerpt:
replicas: {{ .Values.replicaCount }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"This way one chart becomes a variant for testing and one for production through different values.
Alternatives
Kustomize (built into kubectl) works without a template language, using overlays of the YAML files. Many teams combine both or use GitOps tools that apply Helm charts themselves. Charts from third-party sources should be reviewed before use, since they can create permissions in the cluster.
See also: Kubernetes basics, GitOps, Infrastructure as code