Helm Tutorial: Managing Kubernetes Applications
What is Helm?
Helm is the package manager for Kubernetes. It lets you define, install, and upgrade complex Kubernetes applications using reusable packages called charts. Think of it as apt or brew, but for Kubernetes.
Key Concepts
| Term | Description |
|---|---|
| Chart | A package containing all Kubernetes resource definitions for an application |
| Release | A running instance of a chart installed in a cluster |
| Repository | A place where charts are stored and shared |
| Values | Configuration parameters that customize a chart at install time |
Installation
# macOS
brew install helm
# Linux
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
Verify the installation:
helm version
Adding a Chart Repository
Add the Bitnami repository — one of the most popular sources for production-ready charts:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
Search for available charts:
helm search repo nginx
Installing a Chart
Install NGINX from Bitnami:
helm install my-nginx bitnami/nginx
The format is helm install <release-name> <repo/chart>. Helm creates all required Kubernetes resources and tracks the release state.
List running releases:
helm list
Customizing with Values
Every chart exposes configurable values. View the defaults:
helm show values bitnami/nginx
Override values at install time using --set or a values file:
# Inline override
helm install my-nginx bitnami/nginx --set replicaCount=2
# File-based override
helm install my-nginx bitnami/nginx -f custom-values.yaml
A custom-values.yaml example:
replicaCount: 2
service:
type: ClusterIP
resources:
requests:
cpu: 100m
memory: 128Mi
Upgrading a Release
Apply configuration changes or a chart version bump to a running release:
helm upgrade my-nginx bitnami/nginx --set replicaCount=3
Use --install to install when not already present (upsert pattern):
helm upgrade --install my-nginx bitnami/nginx -f custom-values.yaml
Rolling Back
If something goes wrong, roll back to a previous revision:
# Show revision history
helm history my-nginx
# Roll back to revision 1
helm rollback my-nginx 1
Uninstalling a Release
helm uninstall my-nginx
This removes all Kubernetes resources associated with the release. Add --keep-history if you want to retain the release record for auditing.
Creating Your Own Chart
Generate a chart scaffold:
helm create my-app
This produces the standard directory layout:
my-app/
├── Chart.yaml # Chart metadata (name, version, description)
├── values.yaml # Default configuration values
└── templates/ # Kubernetes manifest templates
├── deployment.yaml
├── service.yaml
└── _helpers.tpl # Reusable template snippets
If you want to support me, buy me a coffee.