Skip to content

Helm — Kubernetes Package Manager

Helm is the package manager for Kubernetes. It bundles multiple Kubernetes manifests into a chart — a reusable, versioned, configurable unit.

Without Helm you manage many YAML files manually. Helm:

  • Templates manifests with variables (image tag, replica count, etc.)
  • Versions deployments (install, upgrade, rollback)
  • Packages applications for sharing via repositories
Terminal window
# macOS
brew install helm
# Windows (winget)
winget install Helm.Helm
# Linux
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
my-chart/
├── Chart.yaml # chart metadata (name, version, description)
├── values.yaml # default configuration values
├── templates/
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ └── _helpers.tpl # named template helpers
└── charts/ # dependent charts

Chart.yaml:

apiVersion: v2
name: my-app
description: My application chart
version: 1.0.0
appVersion: "2.3.1"

Default values that users can override:

replicaCount: 2
image:
repository: myrepo/my-app
tag: "1.0"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: false

Templates use Go templating. Reference values with {{ .Values.key }}:

templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-app
spec:
replicas: {{ .Values.replicaCount }}
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Terminal window
# Add a repository
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
# Search for charts
helm search repo nginx
# Install a chart
helm install my-release bitnami/nginx
# Install with custom values
helm install my-release bitnami/nginx \
--set replicaCount=3 \
--values custom-values.yaml
# List installed releases
helm list
# Upgrade a release
helm upgrade my-release bitnami/nginx --set replicaCount=5
# Rollback to previous version
helm rollback my-release 1
# Uninstall
helm uninstall my-release
# Preview rendered templates without installing
helm template my-release ./my-chart
# Check for issues before install
helm lint ./my-chart

Inline:

Terminal window
helm install my-app ./my-chart \
--set image.tag=2.0 \
--set replicaCount=5

Values file:

Terminal window
helm install my-app ./my-chart -f prod-values.yaml

prod-values.yaml:

replicaCount: 5
image:
tag: "2.0"
ingress:
enabled: true
Terminal window
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add cert-manager https://charts.jetstack.io
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami