Ravindra BagaleCourses & study guides मराठी

Chapter 85: Helm for Kubernetes

DevOps

85.1 Why Helm — YAML folders versus one chart

Story. At a Flipkart-style marketplace in Bengaluru, Priya and Omar kept three folders of Kubernetes YAML: one for the product API, one for the cart, one for payments. Every release they copied files, changed the image tag in four places, and once Omar forgot the ConfigMap in staging. Friday night the cart still pointed at the old Redis password. With Helm they put one chart per app, set image.tag in values, and the same command upgraded staging and prod with different value files. That is why Helm exists: one package, many environments, fewer forgotten files.

YAML folders Missed file Helm chart values .yaml One release
Raw YAML folders drift. A Helm chart packs templates plus values into one release.

Why

Copying YAML by hand does not scale. Image tags, replica counts and hostnames change per environment. Helm keeps the structure in templates and the differences in values.

What

  • Helm — A package manager for Kubernetes.
  • Chart — A folder with templates and default values.
  • Release — One installed instance of a chart in a cluster (for example cart-prod).
  • values.yaml — Default knobs (image, replicas, env).
  • templates/ — Kubernetes YAML with Go template placeholders like {{ .Values.image.tag }}.

How

  1. Put shared YAML under templates/.
  2. Put differences in values.yaml and env files like values-staging.yaml.
  3. Install or upgrade with Helm so every object is one release.

Example 1: Same app, two environments

A Swiggy-style team in Pune ships order-api to staging (1 replica) and prod (4 replicas).

helm upgrade --install order-api ./order-api -f values-staging.yaml -n staging --create-namespace
helm upgrade --install order-api ./order-api -f values-prod.yaml -n prod --create-namespace

Output

Release "order-api" has been upgraded. Happy Helming!
NAME: order-api
NAMESPACE: staging
STATUS: deployed
REVISION: 3

What it shows: One chart, two value files, two namespaces. Revision 3 means this was the third change to that release.

Example 2: What raw YAML forgot

Omar's forgotten ConfigMap would still be missing if he only ran kubectl apply -f deploy.yaml. A chart lists every object the app needs, so helm upgrade applies the full set.

Ravindra Bagale's Tip

Name the release after the app and environment intent, for example order-api in namespace prod — not helm1.

Quick quiz

Q1. What is a Helm release?

One installed instance of a chart in a cluster.

Q2. Where do environment differences live?

In values files, not by editing templates by hand each time.

Q3. Why is Helm safer than random kubectl apply?

It tracks revision history and upgrades the whole chart set together.

Did you understand? Let us try it once more.