When you deploy your Task API to Kubernetes using kubectl, you apply individual YAML files—one for the Deployment, one for the Service, one for the ConfigMap, maybe one for the Secret. That's 5-10 files for a single service.
Now imagine managing this across three environments: dev, staging, production. Each environment needs different resource limits, different image tags, different replicas. You copy and modify the same files ten times, creating drift and bugs.
Helm solves this problem. Helm is the package manager for Kubernetes. Instead of managing individual YAML files, you create a Helm chart—a templated package that parameterizes your deployment. Change one value file, and your entire Task API deployment adapts automatically.
This lesson teaches you to understand why Helm exists, install it, deploy a public chart, create your own custom chart for your Task API, and manage releases across environments.
Before Helm, deploying an application to Kubernetes meant writing YAML files by hand:
This works for one environment. But in production, you need:
Now you maintain three copies of the same files, edited manually. When you update the base deployment, you must remember to update all three copies. This is error-prone and doesn't scale.
Helm templating solves this. Instead of three copies, you write once with placeholders:
Then provide three values files—one for each environment:
A single helm install task-api ./task-api-chart -f values-prod.yaml command deploys the entire stack to production with the correct configuration.
Helm is a CLI tool you install on your machine. It then communicates with your Kubernetes cluster to deploy charts.
Output:
Output:
Or using Scoop:
Output:
Helm is now installed and ready to deploy charts.
A Helm chart is a directory with a specific structure:
Each file serves a purpose:
When you run helm install, Helm:
Before creating your own chart, let's deploy a public chart to understand how Helm works.
The Bitnami Helm repository provides production-ready charts for common applications. Let's add it and install Redis:
Output:
Output:
Output:
Output:
Output:
Output:
You deployed a production-grade Redis instance with a single helm install command. Helm templated all the Redis manifests, applied them to Kubernetes, and created a release called my-redis that you can upgrade, downgrade, or rollback.
Now you'll create a custom chart for your Task API from Chapter 79. Instead of managing raw YAML files, you'll use Helm's templating to create a reusable package.
Helm provides a generator to create the basic chart structure:
Output:
Output:
Output:
This declares the chart metadata. Update it for your Task API:
Output:
This is the template of all values. Each value is referenced by name in templates (e.g., {{ .Values.replicaCount }}). Update values.yaml for your Task API:
Output:
This template uses Go template syntax:
Before deploying, preview what Helm will generate:
Output:
Helm rendered the templates with values from values.yaml. The output is valid Kubernetes YAML.
Now create environment-specific value files to customize deployments:
Output:
Verify the deployment:
Output:
Notice: 1 replica in dev (from values-dev.yaml).
Output:
Verify:
Output:
Notice: 5 replicas in production (from values-prod.yaml).
A release is an instance of a chart deployed to your cluster. You manage releases with four operations: install, upgrade, rollback, and uninstall.
Output:
You've pushed a new version of your agent image. Update the release to use it:
Output:
Notice the revision changed from 1 to 2. Helm tracks every release change.
Verify the rollout:
Output:
Output:
The new version has a bug. Rollback to revision 1:
Output:
Verify:
Output:
A new revision (3) was created that rolls back to revision 1's configuration. The agent is now running the old image again.
Output:
All Kubernetes resources created by this release are deleted:
Output:
You now understand:
With these skills, you can package any Kubernetes application—including your Task API—into a reusable, versioned Helm chart that deploys consistently across environments.