Installing Helm
Bash
# Linux
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# macOS
brew install helm
# Check version
helm versionCore Concepts
| Term | Description |
|---|---|
| Chart | Helm package (collection of Kubernetes resource templates) |
| Repository | Chart repository |
| Release | Chart instance deployed to a cluster |
| Values | Chart configuration values (values.yaml) |
Repository Management
Bash
# Add the official stable repo
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
# List repos
helm repo list
# Update repos
helm repo update
# Search charts
helm search repo nginx
helm search repo bitnami/postgresqlDeploying Charts (install / upgrade)
Bash
# Basic install
helm install my-nginx ingress-nginx/ingress-nginx
# Specify a namespace
helm install my-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace
# Customize with a values.yaml file
helm install my-app bitnami/wordpress -f custom-values.yaml
# Override values from the command line
helm install my-pg bitnami/postgresql --set auth.postgresPassword=MySecretPass --set primary.persistence.size=20Gi
# Dry run (preview without deploying)
helm install my-app bitnami/nginx --dry-run --debug
# Upgrade (install if missing)
helm upgrade --install my-nginx ingress-nginx/ingress-nginxRelease Management
Bash
# List deployed releases
helm list
helm list -A # All namespaces
# Release status
helm status my-nginx
# Show applied values
helm get values my-nginx
# Release history
helm history my-nginx
# Rollback
helm rollback my-nginx 1 # To revision 1
# Uninstall
helm uninstall my-nginxCreating Your Own Chart
Bash
helm create mychart
# Generated structure
mychart/
├── Chart.yaml # Chart metadata
├── values.yaml # Default values
├── templates/ # Kubernetes resource templates
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ └── _helpers.tpl # Shared template helpers
└── charts/ # Dependent chartsCustomizing values.yaml
YAML
# values.yaml
replicaCount: 3
image:
repository: nginx
tag: "1.25"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi
ingress:
enabled: true
host: myapp.example.comTemplate Syntax Basics
YAML
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mychart.fullname" . }}
labels:
{{- include "mychart.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.service.port }}
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- end }}Bash
# Preview rendered templates
helm template mychart ./mychart -f my-values.yaml
# Lint
helm lint ./mychartEditorial note
AI tools may assist drafting. Check the evidence in each guide for whether commands were run and which environment was used. Confirm the current docs for your version before applying instructions, and email us about errors. email us
Topic-related official docs (auto-linked · not per-claim sources)Kubernetes documentation ↗Docker documentation ↗
Questions & answers
Ask a question about this guide. We'll review and reply.