Skip to main content

Helm and Helm Chart

Helm is the package manager for Kubernetes. It bundles manifests into a versioned chart, fills in environment-specific values at deploy time, and tracks each installation as a release that can be upgraded or rolled back.

Helm in one picture

A chart is a package, values.yaml supplies defaults, and a release is one installed instance of a chart. The same chart can be installed many times with different names, namespaces, and values.

flowchart TD C["Chart
templates and defaults"] --> H["helm install"] V["values files
per environment"] -->|"override defaults"| H H -->|"renders YAML"| K["Kubernetes cluster"] K --> R["Release
with revision history"] classDef pkg fill:#FFEDD5,color:#1E293B classDef tool fill:#326CE5,color:#ffffff classDef out fill:#D1FAE5,color:#1E293B class C,V pkg class H tool class K,R out

Chart structure

TEXT
my-chart/
Chart.yaml name, chart version, appVersion
values.yaml default configuration
templates/
deployment.yaml
service.yaml
ingress.yaml
YAML
apiVersion: v2
name: devops-network
description: Helm chart for the DevOps Network web app
type: application
version: 0.1.2 # chart version, bump on template changes
appVersion: "1.0.0" # version of the application itself

Templates use Go templating:

YAML
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.service.port }}

values.yaml and overrides

Defaults live in values.yaml. Environment files only list what changes.

YAML
# values.yaml
replicaCount: 2
image:
repository: 123456789012.dkr.ecr.ap-south-1.amazonaws.com/my-app
tag: "1.0.0"
service:
port: 3000
resources:
requests: { cpu: 100m, memory: 256Mi }
limits: { memory: 512Mi }
YAML
# prod.values.yaml
replicaCount: 4
Common Mistake

Putting secrets in values files committed to Git. Reference Kubernetes Secrets or use an external secrets operator instead.

Releases

Bash
helm upgrade --install devops-network ./chart -f prod.values.yaml -n production --atomic --wait
helm list -n production
helm history devops-network -n production
helm rollback devops-network 2 -n production
helm uninstall devops-network -n production
helm template devops-network ./chart -f prod.values.yaml # preview rendered YAML

--atomic rolls back automatically if the upgrade fails.

Security

Rollback restores Kubernetes resources, not database migrations or external state. Test rollbacks before you need them.

Helmfile

Helmfile is a declarative layer over Helm. One file defines all releases and environments, and helmfile apply deploys them.

YAML
environments:
dev: {}
prod: {}
releases:
- name: devops-network
chart: ./chart
namespace: devops-network
values:
- values.yaml
- "{{ .Environment.Name }}.values.yaml"
Bash
helmfile -e dev diff
helmfile -e dev apply

OCI chart registries

Charts can be stored in OCI registries such as ECR, GHCR, or Docker Hub.

Bash
aws ecr get-login-password --region ap-south-1 \
| helm registry login 123456789012.dkr.ecr.ap-south-1.amazonaws.com --username AWS --password-stdin
helm package ./chart
helm push devops-network-0.1.2.tgz oci://123456789012.dkr.ecr.ap-south-1.amazonaws.com/helm-charts
Tip

Use helm diff upgrade before production upgrades and pin chart versions in CI.

Frequently Asked Questions

What is the difference between chart version and appVersion?

version is the version of the chart package and must change when templates change. appVersion describes the application the chart deploys. They move independently.

When should I use Helm instead of Kustomize?

Helm suits distributing and installing reusable applications with a few overridden values. Kustomize patches your own plain manifests without templating. Many teams use Helm for third-party software and Kustomize for in-house overlays.

What is a Helm release?

One installed instance of a chart in a namespace, with its own name, values, and revision history. Installing the same chart twice creates two releases.

Found a mistake, an outdated step or a broken link?