Helm cheat sheet

Helm cheat sheet

Helm 3 uses your ~/.kube/config, so it targets the same cluster kubectl does.

Repositories

TaskCommand
Addhelm repo add podinfo https://stefanprodan.github.io/podinfo
List / update / removehelm repo list / helm repo update / helm repo remove podinfo
Search a repohelm search repo podinfo
Search Artifact Hubhelm search hub postgres
Show all versionshelm search repo podinfo --versions

Look before you install

TaskCommand
Chart metadatahelm show chart podinfo/podinfo
Configurable valueshelm show values podinfo/podinfo
Readmehelm show readme podinfo/podinfo
Render locally, no clusterhelm template ./myapp
Render server-side, no installhelm install web ./myapp --dry-run --debug

Releases

TaskCommand
Installhelm install web podinfo/podinfo
Generated namehelm install podinfo/podinfo --generate-name
Into a namespace, creating ithelm install web podinfo/podinfo -n dev --create-namespace
Override on the command linehelm install web podinfo/podinfo --set replicaCount=3
Override from a filehelm install web podinfo/podinfo -f my-values.yaml
Wait for readinesshelm install web podinfo/podinfo --wait --timeout 5m
Listhelm list / helm list -A
What is deployedhelm get manifest web / helm get values web
Upgradehelm upgrade web podinfo/podinfo --set replicaCount=5
Upgrade or installhelm upgrade --install web podinfo/podinfo
Historyhelm history web
Roll backhelm rollback web 1
Uninstallhelm uninstall web
Statushelm status web

--set beats -f, and a later -f beats an earlier one.

Building a chart

TaskCommand
Scaffoldhelm create myapp
Linthelm lint myapp
Packagehelm package myapp
Dependencieshelm dependency update myapp
Install from dir / tarballhelm install demo ./myapp / ./myapp-0.1.0.tgz

Template snippets

{{ .Values.replicaCount }}                   value from values.yaml
{{ .Chart.Name }} / {{ .Chart.AppVersion }}  from Chart.yaml
{{ .Release.Name }} / {{ .Release.Namespace }}  set at install time
{{ .Values.tag | default "latest" | quote }}  pipeline + default + quoting
{{ required "image.repository is required" .Values.image.repository }}
{{- if .Values.ingress.enabled }} ... {{- end }}
{{ include "myapp.fullname" . }}             macro from _helpers.tpl

{{- trims whitespace before, -}} after. Wrong indentation is the number one chart bug.

Reference

helm.sh/docs/helm