Skip to main content

Helm: The Package Manager

Key Takeaways for AI & Readers
  • Templating Engine: Helm eliminates YAML duplication by allowing you to define generic templates and inject environment-specific values.
  • Charts and Releases: A "Chart" is the package of templates, while a "Release" is a specific instance of that chart running in your cluster.
  • Lifecycle Management: Helm provides simple commands (install, upgrade, rollback) to manage the entire lifecycle of complex applications.

Kubernetes manifests (YAML) can get repetitive. If you want to deploy the same app to dev, staging, and prod, you don't want to copy-paste the file 3 times just to change the imageTag.

Helm solves this by treating Kubernetes YAMLs as Templates.

Visualizing Helm

Helm takes a Template (logic) and combines it with Values (config) to generate the final Manifest (output).

values.yaml

Helm Engine
⚓️

deployment.yaml


apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  template:
    spec:
      containers:
      - image: my-app:1.2.0
Generated

Key Concepts

1. Chart

A package of pre-configured Kubernetes resources. It's a folder containing:

  • templates/: The YAML files with {{ .Values.key }} placeholders.
  • values.yaml: The default configuration.
  • Chart.yaml: Metadata (version, name).

2. Release

An instance of a chart running in a Kubernetes cluster. You can install the same chart multiple times (e.g., mysql-dev and mysql-prod).

3. Repository

A place where charts are stored and shared (like Docker Hub, but for Charts).

  • Artifact Hub: The official search engine for public charts.

Basic Commands

# Add a repo
helm repo add bitnami https://charts.bitnami.com/bitnami

# Install a chart
helm install my-mysql bitnami/mysql --set auth.rootPassword=secret

# Upgrade a release
helm upgrade my-mysql bitnami/mysql --set auth.rootPassword=new-secret

# Uninstall
helm uninstall my-mysql