Helm in Depth cheat sheet
60 commands from every lesson of Helm in Depth — From Charts to a Platform Library, 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) |
Library chart workflow
type: library | In the library's Chart.yaml: templates only, nothing rendered on its own |
dependencies: [ { name: platform-lib, version: 1.2.0, repository: oci://registry/charts } ] | In the service chart's Chart.yaml |
helm dependency update ./orders | Fetch dependencies, write Chart.lock |
helm template orders ./orders | Render the service with the library's defaults |
helm lint ./orders | Lint the result |
CRDs
helm install … --skip-crds | Install without the chart's crds/ folder (CRDs managed elsewhere) |
kubectl apply --server-side -f crds/ | Install or upgrade CRDs yourself (large CRDs need server-side apply) |
kubectl get crd <name> -o jsonpath='{.spec.versions[*].name}' | Which API versions a CRD serves |
Hooks
helm.sh/hook: pre-upgrade | Run this resource before the upgrade's manifests are applied |
helm.sh/hook-weight: "-5" | Order among hooks (lower first) |
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded | Clean up hook resources |
helm test orders -n shop | Run the chart's test hooks |
Test pipeline
helm lint ./orders --strict | Chart structure and template problems |
helm template orders ./orders -f ci/prod-values.yaml > rendered.yaml | Render with realistic values |
kubeconform -strict -summary rendered.yaml | Validate against Kubernetes schemas (add CRD schemas for custom kinds) |
helm unittest ./orders | Run unit tests in tests/*_test.yaml (helm-unittest plugin) |
kyverno apply policies/ --resource rendered.yaml | Check rendered output against platform policies |
ct lint --charts ./orders && ct install --charts ./orders | chart-testing: lint, version bump check, install on a cluster |
Argo CD with Helm
argocd app manifests orders | What Argo CD rendered from the chart |
argocd app diff orders | Rendered chart vs live cluster |
argocd app get orders --show-params | Helm parameters and value files in use |
helm list -A | Shows nothing for Argo-managed apps: Argo CD does not create Helm releases |
OCI charts
helm package ./orders | Create orders-0.1.0.tgz |
helm push orders-0.1.0.tgz oci://registry.example.com/charts | Publish to an OCI registry |
helm pull oci://registry.example.com/charts/orders --version 0.1.0 | Fetch a specific version |
cosign sign registry.example.com/charts/orders@sha256:<digest> | Sign the chart artifact by digest |
cosign verify --key cosign.pub registry.example.com/charts/orders:0.1.0 | Verify before use |
helm template x <chart> | grep -E '^\s*image:' | sort -u | List images a chart will deploy (for mirroring) |
Diagnose
helm status orders -n shop | Current revision and status |
helm history orders -n shop | deployed / failed / pending-upgrade per revision |
kubectl get events -n shop --sort-by=.lastTimestamp | tail -20 | What Kubernetes refused or is waiting for |
kubectl get secret -n shop -l owner=helm,name=orders -L status,version | Revision Secrets and their status labels |
Recover
helm rollback orders <last-deployed-revision> -n shop | Return to the last good revision |
kubectl annotate <kind>/<name> -n shop meta.helm.sh/release-name=orders meta.helm.sh/release-namespace=shop | Adopt an existing object (plus label app.kubernetes.io/managed-by=Helm) |
Common chart anti-patterns
Everything configurable | Hundreds of values; nobody knows which matter; untestable |
Logic in templates | Deep if/else nesting instead of simple defaults |
Secrets in values | Passwords in Git and in every release revision |
Floating versions | Unpinned dependencies and latest image tags |
Missing defaults | No probes, resources, securityContext or PDB |
CRDs in templates/ | Uninstall deletes every custom resource |
Manual helm install in production | No review, no audit trail, drift |