Skip to content

Helm Cheatsheet

Package manager for Kubernetes — manage charts and releases.

01

Getting Started

Commands

Core Helm commands.

helm
# helm create mychart
# helm install myapp ./mychart
# helm upgrade myapp ./mychart
# helm uninstall myapp
# helm list

Chart Structure

Standard chart directory structure.

helm
mychart/
  Chart.yaml          # chart metadata
  values.yaml         # default values
  templates/
    deployment.yaml
    service.yaml
    _helpers.tpl
02

Templates

Values

Access values with .Values; default filter.

helm
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.name }}
spec:
  replicas: {{ .Values.replicas | default 1 }}

Helpers

Define and include template helpers.

helm
{{- define "labels" -}}
app: {{ .Chart.Name }}
version: {{ .Chart.Version }}
{{- end -}}

metadata:
  labels:
{{ include "labels" . | indent 4 }}

Loops

Range for iteration in templates.

helm
{{- range .Values.services }}
- name: {{ .name }}
  port: {{ .port }}
{{- end }}

Was this helpful?