Helm · Cheat sheet

Helm cheat sheet

Helm cheat sheet: repos, install/upgrade, values, chart authoring, dependencies, rollback, and OCI registries.

52 commands·9 sections·Updated ·By SecOpsLog

Rows marked Destructive State operation Caution Exposes secrets can remove data, change authoritative state, affect a running system, or print secrets. Read the note before running them against anything that matters.

Beginner
helm version
Helm client version.
helm repo add podinfo https://stefanprodan.github.io/podinfo
Register a classic (HTTP index) chart repository.
helm repo update
Refresh the local cache of chart indexes.
helm repo list
List configured repositories.
helm search repo podinfo
Search added repos for a chart.Example output
NAME             CHART VERSION  APP VERSION  DESCRIPTION
podinfo/podinfo  6.15.0         6.15.0       Podinfo Helm chart for Kubernetes
helm search hub wordpress
Search Artifact Hub across all public repos.

Install & upgrade

Beginner
helm install web oci://ghcr.io/stefanprodan/charts/podinfo --version 6.15.0
Install straight from an OCI registry, pinned; no repo add needed.
helm install web podinfo/podinfo
Install a chart as a named release.Example output
NAME: web
STATUS: deployed
REVISION: 1
helm install web ./mychart
Install from a local chart directory.
helm upgrade web ./mychart
Apply changes to an existing release.
helm upgrade --install web ./mychart
Install if absent, upgrade if present (idempotent).
helm upgrade web ./mychart --rollback-on-failure
Roll back automatically if the upgrade fails (was --atomic before Helm 4).
helm upgrade web ./mychart --wait --timeout 5m
Block until resources are Ready.
helm upgrade web ./c --server-side=true
Switch a release to server-side apply (Helm 4 default for new installs only).
helm uninstall webDestructive
Remove a release and its resources.Destructive: Deletes every resource of the release plus its revision history.
helm uninstall web --keep-historyDestructive
Uninstall but keep revision history.Destructive: Still deletes all release resources; only the revision history is kept.

Values

Intermediate
helm install web ./c -f prod.yaml
Override defaults with a values file.
helm install web ./c -f a.yaml -f b.yaml
Layer multiple files (last wins).
helm install web ./c --set image.tag=1.4.0
Override a single value inline.
helm install web ./c --set-string port=8080
Force a value to be treated as a string.
helm show values podinfo/podinfo
Print a chart’s default values.yaml.
helm get values web
Show the values a release was installed with.

Inspect releases

Beginner
helm list
Releases in the current namespace.Example output
NAME  NAMESPACE  REVISION  STATUS    CHART
web   default    3         deployed  podinfo-6.15.0
helm list -A
Releases across all namespaces.
helm status web
Current status, notes and resources of a release.
helm get manifest web
The exact YAML Helm applied to the cluster.
helm get all web
Everything: values, manifest, hooks, notes.
helm history web
Revision history with status per revision.

Templating & debug

Intermediate
helm template web ./mychart
Render manifests locally without installing.
helm template web ./c -f prod.yaml --debug
Render with values + verbose errors.
helm install web ./c --dry-run=serverExposes secrets
Simulate the install against the API server; nothing is persisted.Exposes secrets: Prints every rendered manifest, including Secrets; add --hide-secret to redact.
helm lint ./mychart
Check a chart for problems and best practices.Example output
==> Linting ./mychart
1 chart(s) linted, 0 chart(s) failed
helm get manifest web | kubectl diff -f -
Diff a release against the live cluster.

Chart authoring

Intermediate
helm create mychart
Scaffold a new chart with example templates.Example output
Creating mychart
mychart/
  Chart.yaml  values.yaml  templates/
{{ .Values.image.tag }}
Reference a value inside a template.
{{ .Release.Name }}-web
Built-in objects: .Release, .Chart, .Capabilities.
{{ include "mychart.labels" . | nindent 4 }}
Reuse a named template (helper).
{{- if .Values.ingress.enabled }}
Conditionals; {{- trims preceding whitespace.
{{ .Values.name | default "web" | quote }}
Pipe through template functions.

Dependencies

Intermediate
helm dependency update ./mychart
Fetch subcharts listed in Chart.yaml into charts/.
helm dependency build ./mychart
Rebuild charts/ from the existing lock file.
helm dependency list ./mychart
Show subcharts and whether they are present.

Rollback & release ops

Intermediate
helm rollback web 2Caution
Revert a release to a previous revision.Caution: Re-applies an old revision to the live release, pods included.Example output
Rollback was a success! Happy Helming!
helm rollback webCaution
Roll back to the immediately previous revision.Caution: Re-applies an old revision to the live release, pods included.
helm upgrade web ./c --description "hotfix"
Annotate a revision for the history log.

Packaging & OCI

Advanced
helm package ./mychart
Build a versioned .tgz chart archive.Example output
Successfully packaged chart and saved it to: mychart-0.1.0.tgz
helm package ./mychart --version 1.2.0 --app-version 2.0
Override chart/app versions at package time.
helm push mychart-1.2.0.tgz oci://reg.io/charts
Push a chart to an OCI registry.
helm install web oci://reg.io/charts/mychart --version 1.2.0
Install directly from OCI.
helm registry login reg.io
Authenticate to an OCI registry.
helm test web
Run a chart’s test hooks against the release.
helm plugin install https://github.com/databus23/helm-diffCaution
Add helm-diff (preview upgrades).Caution: A Git URL install is not signature-checked; on Helm 4 install the release .tgz, which is verified against its .prov file.

Primary references

Found a technical issue on this page? Report it with the tool version you used and the behavior you saw. How resources are maintained.

Go deeper
Hands-on courses for Helm