Cheat Sheets / CI/CD & GitOps

Helm in Depth cheat sheet

60 commands from every lesson of Helm in Depth — From Charts to a Platform Library, on one page.

01 · Releases, upgrades and rollbacks

Release lifecycle

helm upgrade --install orders ./orders -n shop --create-namespaceInstall or upgrade in one idempotent command
helm upgrade orders ./orders -n shop --atomic --wait --timeout 5mWait for readiness; roll back automatically on failure
helm history orders -n shopRevisions with status and description
helm rollback orders 3 -n shopRe-apply revision 3 as a new revision
helm get values orders -n shop --allEvery value used by the current revision
helm get manifest orders -n shopExactly what Helm applied
kubectl get secret -n shop -l owner=helm,name=ordersWhere Helm stores each revision

02 · Templates and helpers

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 . --debugRender locally and show errors with context

03 · Values at scale

Values in practice

helm upgrade --install orders ./orders -f values/base.yaml -f values/prod.yaml -f values/prod-eu.yamlLayered files; later files win
helm show values ./ordersChart defaults
helm template ./orders -f values/prod.yaml --set tier=goldSchema rejects invalid input before rendering
helm diff upgrade orders ./orders -f values/prod.yaml -n shopPreview changes against the live release (helm-diff plugin)

04 · Library and umbrella charts

Library chart workflow

type: libraryIn 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 ./ordersFetch dependencies, write Chart.lock
helm template orders ./ordersRender the service with the library's defaults
helm lint ./ordersLint the result

05 · CRDs and hooks

CRDs

helm install … --skip-crdsInstall 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-upgradeRun 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-succeededClean up hook resources
helm test orders -n shopRun the chart's test hooks

06 · Testing charts

Test pipeline

helm lint ./orders --strictChart structure and template problems
helm template orders ./orders -f ci/prod-values.yaml > rendered.yamlRender with realistic values
kubeconform -strict -summary rendered.yamlValidate against Kubernetes schemas (add CRD schemas for custom kinds)
helm unittest ./ordersRun unit tests in tests/*_test.yaml (helm-unittest plugin)
kyverno apply policies/ --resource rendered.yamlCheck rendered output against platform policies
ct lint --charts ./orders && ct install --charts ./orderschart-testing: lint, version bump check, install on a cluster

07 · Helm with Argo CD

Argo CD with Helm

argocd app manifests ordersWhat Argo CD rendered from the chart
argocd app diff ordersRendered chart vs live cluster
argocd app get orders --show-paramsHelm parameters and value files in use
helm list -AShows nothing for Argo-managed apps: Argo CD does not create Helm releases

08 · Distributing and securing charts

OCI charts

helm package ./ordersCreate orders-0.1.0.tgz
helm push orders-0.1.0.tgz oci://registry.example.com/chartsPublish to an OCI registry
helm pull oci://registry.example.com/charts/orders --version 0.1.0Fetch 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.0Verify before use
helm template x <chart> | grep -E '^\s*image:' | sort -uList images a chart will deploy (for mirroring)

09 · Failed upgrades and recovery

Diagnose

helm status orders -n shopCurrent revision and status
helm history orders -n shopdeployed / failed / pending-upgrade per revision
kubectl get events -n shop --sort-by=.lastTimestamp | tail -20What Kubernetes refused or is waiting for
kubectl get secret -n shop -l owner=helm,name=orders -L status,versionRevision Secrets and their status labels

Recover

helm rollback orders <last-deployed-revision> -n shopReturn to the last good revision
kubectl annotate <kind>/<name> -n shop meta.helm.sh/release-name=orders meta.helm.sh/release-namespace=shopAdopt an existing object (plus label app.kubernetes.io/managed-by=Helm)

10 · Capstone: from copied charts to one library

Common chart anti-patterns

Everything configurableHundreds of values; nobody knows which matter; untestable
Logic in templatesDeep if/else nesting instead of simple defaults
Secrets in valuesPasswords in Git and in every release revision
Floating versionsUnpinned dependencies and latest image tags
Missing defaultsNo probes, resources, securityContext or PDB
CRDs in templates/Uninstall deletes every custom resource
Manual helm install in productionNo review, no audit trail, drift