Helm — Kubernetes Package Manager
Helm — Kubernetes Package Manager
Section titled “Helm — Kubernetes Package Manager”Helm is the package manager for Kubernetes. It bundles multiple Kubernetes manifests into a chart — a reusable, versioned, configurable unit.
Why Helm
Section titled “Why Helm”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
Installing Helm
Section titled “Installing Helm”# macOSbrew install helm
# Windows (winget)winget install Helm.Helm
# Linuxcurl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bashChart Structure
Section titled “Chart Structure”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 chartsChart.yaml:
apiVersion: v2name: my-appdescription: My application chartversion: 1.0.0appVersion: "2.3.1"values.yaml
Section titled “values.yaml”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: falseTemplate Files
Section titled “Template Files”Templates use Go templating. Reference values with {{ .Values.key }}:
apiVersion: apps/v1kind: Deploymentmetadata: name: {{ .Release.Name }}-appspec: replicas: {{ .Values.replicaCount }} template: spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"Essential Commands
Section titled “Essential Commands”# Add a repositoryhelm repo add bitnami https://charts.bitnami.com/bitnamihelm repo update
# Search for chartshelm search repo nginx
# Install a charthelm install my-release bitnami/nginx
# Install with custom valueshelm install my-release bitnami/nginx \ --set replicaCount=3 \ --values custom-values.yaml
# List installed releaseshelm list
# Upgrade a releasehelm upgrade my-release bitnami/nginx --set replicaCount=5
# Rollback to previous versionhelm rollback my-release 1
# Uninstallhelm uninstall my-release
# Preview rendered templates without installinghelm template my-release ./my-chart
# Check for issues before installhelm lint ./my-chartOverriding Values at Install
Section titled “Overriding Values at Install”Inline:
helm install my-app ./my-chart \ --set image.tag=2.0 \ --set replicaCount=5Values file:
helm install my-app ./my-chart -f prod-values.yamlprod-values.yaml:
replicaCount: 5image: tag: "2.0"ingress: enabled: truePopular Chart Repositories
Section titled “Popular Chart Repositories”helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginxhelm repo add cert-manager https://charts.jetstack.iohelm repo add prometheus https://prometheus-community.github.io/helm-chartshelm repo add bitnami https://charts.bitnami.com/bitnami