DevOps
Helm
Helm is a package manager for Kubernetes: an application is packaged as a chart with templates and configured through values.
What it is
Helm is called the package manager for Kubernetes. Instead of a dozen YAML files you install one chart: a package with manifest templates and a values.yaml file of parameters.
helm install renders the templates with your values and applies the result to the cluster as a release. helm upgrade updates it and helm rollback reverts, because Helm keeps release history. Charts are published in repositories and OCI registries.
Helm is a CNCF project with graduated status (2020). Alternatives for templating manifests: Kustomize (built into kubectl) and rendering through GitOps tools.
Use it when
- You install ready-made apps into Kubernetes: Prometheus, Postgres, an ingress controller.
- You deploy one app to several environments with different parameters.
- You need versioning, upgrades and rollback of packages.
Avoid it when
- You have a few simple manifests: Kustomize or plain kubectl apply are simpler.
- Go templates become unreadable: reconsider the approach.
Key concepts
- Chart
- A Helm package: templates, default values and metadata.
- Release
- A specific installation of a chart in a cluster with its own name and history.
- values.yaml
- Parameters injected into templates; override them with --set or -f.
- Repository / OCI
- Where charts are published: an HTTP repository or a container registry.
Example
Interview questions
1. What are a chart and a release?
A chart is a package with templates and values. A release is a specific installation of that chart in a cluster. One chart can produce many releases with different parameters.
2. How do you roll back in Helm?
Helm stores release revisions, so helm rollback <release> <revision> restores the previous state. helm history lists the revisions.
3. Helm or Kustomize?
Helm gives templates, packaging and versioning, good for distribution. Kustomize patches plain YAML without templates, simpler for your own manifests. They are often combined.
Interview questions from the bank
Related technologies
- KubernetesKubernetes is a container orchestration system that deploys, scales and heals applications across a cluster of servers.
- Argo CDArgo CD is a GitOps tool for Kubernetes: it watches a Git repository and syncs the cluster to the state described there.
- DockerDocker packages an application with its dependencies into a container that runs the same on a laptop, a server and the cloud.
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).