Helm cheat sheet
Helm cheat sheet
Helm 3 uses your ~/.kube/config, so it targets the same cluster kubectl does.
Repositories
| Task | Command |
|---|
| Add | helm repo add podinfo https://stefanprodan.github.io/podinfo |
| List / update / remove | helm repo list / helm repo update / helm repo remove podinfo |
| Search a repo | helm search repo podinfo |
| Search Artifact Hub | helm search hub postgres |
| Show all versions | helm search repo podinfo --versions |
Look before you install
| Task | Command |
|---|
| Chart metadata | helm show chart podinfo/podinfo |
| Configurable values | helm show values podinfo/podinfo |
| Readme | helm show readme podinfo/podinfo |
| Render locally, no cluster | helm template ./myapp |
| Render server-side, no install | helm install web ./myapp --dry-run --debug |
Releases
| Task | Command |
|---|
| Install | helm install web podinfo/podinfo |
| Generated name | helm install podinfo/podinfo --generate-name |
| Into a namespace, creating it | helm install web podinfo/podinfo -n dev --create-namespace |
| Override on the command line | helm install web podinfo/podinfo --set replicaCount=3 |
| Override from a file | helm install web podinfo/podinfo -f my-values.yaml |
| Wait for readiness | helm install web podinfo/podinfo --wait --timeout 5m |
| List | helm list / helm list -A |
| What is deployed | helm get manifest web / helm get values web |
| Upgrade | helm upgrade web podinfo/podinfo --set replicaCount=5 |
| Upgrade or install | helm upgrade --install web podinfo/podinfo |
| History | helm history web |
| Roll back | helm rollback web 1 |
| Uninstall | helm uninstall web |
| Status | helm status web |
--set beats -f, and a later -f beats an earlier one.
Building a chart
| Task | Command |
|---|
| Scaffold | helm create myapp |
| Lint | helm lint myapp |
| Package | helm package myapp |
| Dependencies | helm dependency update myapp |
| Install from dir / tarball | helm 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