Helm Charts

Difficulty: Intermediate

Question

What is Helm, what is a Helm chart, and how does Helm manage releases?

Answer

Helm is the package manager for Kubernetes. A Helm chart is a versioned package of templated Kubernetes manifests plus default configuration (values.yaml), and Helm renders those templates with your values, applies the result to the cluster, and tracks it as a named release that you can upgrade or roll back.

What is inside a chart

A chart is just a directory (or a .tgz of one) with a fixed layout:

  • Chart.yaml: name, chart version, appVersion, and dependencies
  • values.yaml: default configuration such as image tag, replica count, resources
  • templates/: manifests written as Go templates with Sprig functions, for example replicas: {{ .Values.replicaCount }}
  • templates/_helpers.tpl: reusable named templates for labels and names
  • charts/: dependent sub-charts, such as a Bitnami PostgreSQL or Redis chart

The same chart can deploy to dev, staging and prod by passing different values files, so a team at Flipkart might keep one chart per service and a values-prod.yaml with more replicas and larger limits.

How install, upgrade and rollback work

When you run helm upgrade --install, Helm:

  1. Merges values: chart defaults, then each -f file in order, then --set flags (last wins).
  2. Renders the templates into plain YAML on the client.
  3. Applies the manifests to the cluster and waits if you pass --wait.
  4. Stores the release record (rendered manifest, values, chart metadata) as a Secret named like sh.helm.release.v1.<release>.v<revision> in the release namespace.

Because each revision is stored, helm history shows past versions and helm rollback <release> <revision> re-applies an earlier one. Helm 3 removed the old in-cluster Tiller component, so Helm now uses your kubeconfig credentials and RBAC directly. Helm 4, released in late 2025, keeps the same chart format, so existing apiVersion v2 charts continue to work.

Distribution: repositories and OCI

Charts are shared through classic HTTP chart repositories (helm repo add) or, increasingly, OCI registries such as Docker Hub, GHCR, ECR or Artifact Registry using helm push and oci:// URLs. Artifact Hub is the public index for finding community charts like ingress-nginx, cert-manager and kube-prometheus-stack.

Trade-offs and common mistakes

  • Template complexity: heavy if/range logic makes charts hard to read. For simple per-environment tweaks, Kustomize is often cleaner.
  • Drift: if someone runs kubectl edit on a Helm-managed object, the next upgrade may overwrite it. Treat Helm (or GitOps on top of it) as the only writer.
  • CRDs: files in a chart's crds/ directory are installed once and are never upgraded or deleted by Helm, so CRD upgrades need a separate step.
  • Secrets in values: do not commit passwords in values.yaml; use External Secrets, Sealed Secrets or SOPS.
  • Always preview: helm template, helm lint and helm diff (a plugin) catch mistakes before they reach the cluster.

In production, Helm is commonly driven by GitOps tools like Argo CD or Flux, which render the chart and keep the cluster in sync with Git.

From chart to running release. Helm merges values into templates, applies the YAML and records the release revision.
  1. Chart templates: Go templates in templates/ with defaults in values.yaml.
  2. Merge values: Defaults, then -f files, then --set overrides.
  3. Render YAML: Helm produces plain Kubernetes manifests.
  4. Apply to cluster: Objects are created or updated via the API server.
  5. Store release revision: Saved as a Secret so rollback is possible.

Code examples

Template and values

# values.yaml
replicaCount: 2
image:
  repository: ghcr.io/acme/checkout
  tag: "1.4.0"

# templates/deployment.yaml (excerpt)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "checkout.fullname" . }}
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    spec:
      containers:
        - name: app
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"

Templates reference .Values; changing values.yaml or passing -f values-prod.yaml changes the rendered manifests without editing the templates.

Everyday Helm commands

# Install or upgrade in one idempotent command
helm upgrade --install checkout ./checkout \
  -n shop --create-namespace \
  -f values-prod.yaml --set image.tag=1.5.0 --wait

# Preview the rendered YAML without touching the cluster
helm template checkout ./checkout -f values-prod.yaml

helm list -n shop
helm history checkout -n shop
helm rollback checkout 3 -n shop

# Install a chart from an OCI registry
helm install redis oci://registry-1.docker.io/bitnamicharts/redis

upgrade --install is the standard CI command because it works whether or not the release already exists.

Key points

  • Chart = Chart.yaml + values.yaml + templates/ (+ optional sub-charts in charts/)
  • Values precedence: chart defaults, then -f files in order, then --set
  • Each upgrade creates a revision stored as a Secret, enabling helm rollback
  • Helm 3 removed Tiller; Helm uses your kubeconfig and RBAC
  • CRDs in crds/ are installed once and never upgraded by Helm

Common follow-up questions

  • How does Helm compare to Kustomize, and when would you pick each?
  • How do you handle secrets in a Helm-based deployment?
  • What are Helm hooks and when would you use a pre-upgrade hook?
  • How does Argo CD work with Helm charts?

Interview tips

  • Explain chart, values and release as three separate ideas; many candidates blur them
  • Mention that Helm 3 has no Tiller and stores releases as Secrets, which shows real usage
  • Talk about helm template and helm diff for safe changes in CI

Concepts covered

Helm Chart, values.yaml, Go Templates, Releases and Rollback, OCI Registry

More Kubernetes & Orchestration questions