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
CommandAction / Purpose
helm repo add name urlAdd a Helm chart repository
helm repo updateUpdate local information on available charts from repos
helm search repo nginxSearch indexed repositories for a chart package
helm search hub redisSearch 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 uninstall deletes all Kubernetes resources created by the release without asking for confirmation!

[!TIP] Use helm template my-release ./mychart --debug to render template files locally to stdout and verify YAML syntax before deploying to a cluster.