Kubernetes Helm Charts Cheat Sheet
Quick reference guide for Helm: Helm install/upgrade/rollback, chart structure, templates, and CLI.
Containers & Cloud
helm
kubernetes
k8s
Helm is the package manager for Kubernetes. Helm Charts help you define, install, and upgrade Kubernetes applications.
Repository & Search Commands
Table
| Command | Action / Purpose |
|---|---|
helm repo add name url | Add a Helm chart repository |
helm repo update | Update local information on available charts from repos |
helm search repo nginx | Search indexed repositories for a chart package |
helm search hub redis | Search Artifact Hub for public Helm charts |
Release Management Commands
bash
# Install a chart release with custom values file
helm install my-release bitnami/nginx -f custom-values.yaml --namespace prod
# Upgrade release with atomic rollback on failure
helm upgrade my-release bitnami/nginx --values values.yaml --atomic --timeout 5m
# Rollback release to previous revision (e.g. revision 2)
helm rollback my-release 2
# List deployed releases in namespace
helm list --namespace prod
# Uninstall / delete release
helm uninstall my-release --namespace prod
Chart Directory Layout & Go Template Syntax
text
mychart/
├── Chart.yaml # Chart metadata (name, version, appVersion)
├── values.yaml # Default configuration values
├── templates/ # Kubernetes manifest templates
│ ├── deployment.yaml
│ └── service.yaml
└── charts/ # Sub-chart dependencies
yaml
# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
replicas: {{ .Values.replicaCount | default 1 }}
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Common Pitfalls & Tips
[!WARNING] Running
helm uninstalldeletes all Kubernetes resources created by the release without asking for confirmation!
[!TIP] Use
helm template my-release ./mychart --debugto render template files locally to stdout and verify YAML syntax before deploying to a cluster.