How Helm works · wrap-up
Cheat sheet & self-check
Every command from this section on one page.
Release lifecycle
helm upgrade --install orders ./orders -n shop --create-namespace | Install or upgrade in one idempotent command |
helm upgrade orders ./orders -n shop --atomic --wait --timeout 5m | Wait for readiness; roll back automatically on failure |
helm history orders -n shop | Revisions with status and description |
helm rollback orders 3 -n shop | Re-apply revision 3 as a new revision |
helm get values orders -n shop --all | Every value used by the current revision |
helm get manifest orders -n shop | Exactly what Helm applied |
kubectl get secret -n shop -l owner=helm,name=orders | Where Helm stores each revision |
Template building blocks
{{ define "app.labels" }}…{{ end }} | Named template (put in _helpers.tpl) |
{{ include "app.labels" . | nindent 4 }} | Use it, piped and indented |
{{ required "image.tag is required" .Values.image.tag }} | Fail rendering with a clear message |
{{ .Values.replicas | default 2 }} | Fallback value |
{{ toYaml .Values.resources | nindent 12 }} | Insert a whole YAML block |
{{- … -}} | Trim whitespace before / after |
{{ tpl .Values.hostTemplate . }} | Render a value that itself contains template syntax |
helm template . --debug | Render locally and show errors with context |
Values in practice
helm upgrade --install orders ./orders -f values/base.yaml -f values/prod.yaml -f values/prod-eu.yaml | Layered files; later files win |
helm show values ./orders | Chart defaults |
helm template ./orders -f values/prod.yaml --set tier=gold | Schema rejects invalid input before rendering |
helm diff upgrade orders ./orders -f values/prod.yaml -n shop | Preview changes against the live release (helm-diff plugin) |