Helm for Beginners: Kubernetes Package Management Explained

Deploying one small app to Kubernetes takes a handful of YAML files: a Deployment, a Service, maybe an Ingress and a ConfigMap. Deploying the same app to dev, staging and production, each with different settings, quickly turns into dozens of nearly identical files. Helm exists to stop that copy-and-paste sprawl.

The short answer: Helm is the package manager for Kubernetes. It bundles an app’s Kubernetes manifests into a chart made of templates plus a values.yaml file of settings. You install the chart with one command, override values per environment, upgrade it, and roll back to an earlier release if something goes wrong. Learn it after basic Kubernetes, not before.

Helm shows up in many Kubernetes job descriptions, so it is worth adding once the basics from any DevOps training in Pune are solid. This guide explains how it works, with commands you can run on a local cluster.

The problem Helm solves

Without Helm, a team usually keeps a folder of manifests per environment. Change the image tag and you edit three files. Add a new environment and you copy a folder and hunt for every value that should differ. Mistakes creep in, and nobody is sure which version is running where.

Helm replaces those copies with one set of templates. Anything that changes between environments, such as the replica count, image tag, resource limits or domain name, becomes a value. Helm also records each install as a numbered release, so you can see what is deployed and go back to a previous version with one command.

Charts, values and releases

Three words cover most of Helm. A chart is a folder that describes an app. Values are the settings that fill in the chart’s templates. A release is one installed copy of a chart in a cluster, with its own name and revision history.

A new chart, created with helm create myapp, looks like this:

myapp/
  Chart.yaml        # name, version and description of the chart
  values.yaml       # default settings
  templates/
    deployment.yaml
    service.yaml
    ingress.yaml
    _helpers.tpl    # reusable template snippets

The same chart can be installed many times. Installing it as shop-dev and shop-prod in different namespaces gives you two releases, each with its own values and history.

How templating works

Inside templates/, files are ordinary Kubernetes YAML with placeholders in double curly braces. When you install, Helm reads values.yaml, fills in each placeholder and sends the finished manifests to the cluster.

# values.yaml
replicaCount: 2
image:
  repository: nginx
  tag: "1.27"

# templates/deployment.yaml (excerpt)
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    spec:
      containers:
        - name: web
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"

Notice that the tag is quoted in values.yaml. As our guide to YAML for DevOps explains, an unquoted 1.10 would be read as the number 1.1, which is a classic way to deploy the wrong image.

The commands you will use every day

# Add a public chart repository and search it
helm repo add bitnami https://charts.bitnami.com/bitnami
helm search repo nginx

# See what a chart will produce without installing it
helm template myrelease ./myapp -f values-prod.yaml

# Install, or upgrade if it already exists
helm upgrade --install shop ./myapp -n shop -f values-prod.yaml

# List releases and their history
helm list -n shop
helm history shop -n shop

# Go back to revision 3
helm rollback shop 3 -n shop

helm upgrade --install is the command most CI/CD pipelines use, because it works the same whether the release exists or not. helm template is your best debugging tool: it prints the final YAML so you can see exactly what Helm will apply.

Values per environment

The usual pattern is one chart with a small values file per environment. values.yaml holds the defaults, and files such as values-dev.yaml and values-prod.yaml override only what differs, for example two replicas in dev and six in production, or a different domain name.

You can also override a single value on the command line with --set image.tag=2.4.1. Pipelines often do this to deploy the image they just built, tagged with the commit ID. Our explainer on CI/CD pipelines shows where that deploy step fits.

Using public charts

You do not have to write every chart yourself. Databases, monitoring stacks and ingress controllers are usually installed from public charts maintained by the software’s authors or the community. Artifact Hub is the main place to search for them.

Treat a public chart like any other dependency. Read its values.yaml before installing, pin a chart version rather than taking the latest, and keep your overrides in a file under version control so the setup can be reproduced.

Mistakes beginners make

  • Learning Helm before Kubernetes. If you cannot write a Deployment and Service by hand, Helm’s templates will hide what is happening. Get comfortable with plain manifests first; see Docker vs Kubernetes for the order to learn things in.
  • Putting secrets in values files. Passwords committed to Git are exposed to anyone with access. Use Kubernetes Secrets created from a secrets manager, or a tool such as Sealed Secrets or External Secrets.
  • Over-templating. A chart where every line is a variable is harder to read than plain YAML. Template only what actually changes.
  • Skipping helm template and helm lint. Both catch errors before anything reaches the cluster.

A one-week practice plan

  • Day 1: start a local cluster with kind or minikube and install a public chart, such as an nginx chart, with default values.
  • Day 2: run helm create, read every generated file, and install your own chart.
  • Days 3 and 4: add values files for dev and prod, upgrade between them, then practise helm history and helm rollback.
  • Days 5 to 7: deploy your own app’s image with the chart, and add a helm upgrade --install step to a GitHub Actions workflow.

Frequently asked questions

Is Helm required to work with Kubernetes?

No. You can deploy with plain manifests and kubectl, or with Kustomize, which is built into kubectl. Helm becomes valuable when you manage several environments or install third-party software.

What is the difference between Helm and Kustomize?

Helm uses templates and values, and tracks releases with rollback. Kustomize uses plain YAML with patches layered on top, and has no templating or release history. Many teams use Helm for third-party charts and Kustomize or Helm for their own apps.

Is Helm part of the CKA or CKAD exam?

Exam curricula change, so check the current outline on the Linux Foundation site. Our comparison of CKA vs CKAD explains how the two exams differ.

Does Helm still use Tiller?

No. Tiller was removed in Helm 3. Helm now talks directly to the Kubernetes API using your kubeconfig permissions, which is simpler and more secure.

Facebook
Twitter
LinkedIn
Email
Picture of Wandex
Wandex

DevOps Expert

ENroll Now

Fill up the form and we will contact you 

Get Free Course Syllabus & Counseling

Takes only 10 seconds to fill out!