Helm Charts: Templates, Values, and Releases

Helm is the package manager for Kubernetes. A chart bundles the Kubernetes manifests for an application together with a values.yaml file that holds the settings you want to change per environment.

Create a starter chart and check it before installing:

bash helm create webapp helm lint webapp helm template webapp ./webapp -f values-prod.yaml

helm template renders the manifests locally so you can read them. Nothing is sent to the cluster until you install.

A typical install and upgrade looks like this:

bash helm install webapp ./webapp -n shop --create-namespace -f values-prod.yaml helm upgrade webapp ./webapp -n shop -f values-prod.yaml helm history webapp -n shop helm rollback webapp 2 -n shop

Each install or upgrade creates a numbered revision. helm rollback returns to an earlier revision, which is faster than rebuilding manifests by hand.

Keep these habits in mind:

- Override only the values that differ between environments. - Use --set for quick tests, but keep real overrides in files under version control. - Add --dry-run --debug to see what an install would do without applying it.

Templates use the Go template language, so {{ .Values.image.tag }} reads the image.tag key from values.yaml.