Managing Applications with Helm Charts
Deploying a simple application to Kubernetes usually takes three or four YAML files. Deploying a real production system—complete with APIs, databases, background workers, and security rules—can easily take fifty or more YAML files. Managing all of those files manually across Development, Staging, and Production quickly becomes a nightmare.
Helm solves this problem by treating your Kubernetes infrastructure like package management. Just as you use npm for JavaScript, pip for Python, or NuGet for .NET, you use Helm to bundle, configure, and deploy entire Kubernetes applications with a single command.
- Why raw Kubernetes YAML files fail at scale and how Helm fixes it.
- The exact folder structure of a Helm Chart (
Chart.yaml,values.yaml, andtemplates/). - How to write your own custom Helm chart and inject dynamic variables.
- How to deploy complex third-party apps (like PostgreSQL and Jenkins) as unified packages.
- How to safely upgrade applications and roll back broken releases in seconds.
1. What Is Helm? (Package Management for Kubernetes)
In Kubernetes, every piece of your app is a separate resource: a Deployment, a Service, a ConfigMap, a Secret, and an Ingress. Without Helm, if you want to deploy your app to both a Test cluster and a Production cluster, you have to copy-paste all those YAML files and manually edit replica counts, image tags, and database URLs.
Helm lets you write your YAML files once as reusable templates. You keep the changing parts (like passwords, ports, and replica counts) in a separate configuration file. When you deploy, Helm combines the templates and values into a single versioned package called a Chart.
| Feature | Raw Kubernetes YAML | Helm Charts |
|---|---|---|
| Environment setup | Copy-paste YAML files for Dev, QA, and Prod | One chart with different values.yaml files |
| Deployment command | Run kubectl apply on multiple files |
Single helm install command |
| Rollbacks | Manual git revert and re-apply | Instant one-line helm rollback |
| Third-party tools | Write complex database YAMLs from scratch | Install ready-made charts (PostgreSQL, Redis, Jenkins) |
2. Anatomy of a Helm Chart
A Helm chart is simply a folder containing a specific set of files. You can generate a starter chart automatically using the Helm CLI.
Example 1: Creating a new chart
helm create my-web-api
Generated folder structure
my-web-api/
├── Chart.yaml # Information about the chart (name, version)
├── values.yaml # Default configuration variables
├── charts/ # Dependent charts (e.g., a database your app needs)
└── templates/ # Kubernetes YAML templates with placeholders
├── deployment.yaml
├── service.yaml
└── ingress.yaml
Let's break down the three most important parts:
Chart.yaml: The identity card of your package. It holds the chart name, description, and version number.values.yaml: The control panel. All your customizable settings (image name, port number, CPU limits) live here.templates/: The blueprints. These are standard Kubernetes YAML files, except hardcoded values are replaced with{{ .Values.something }}placeholders.
3. How Helm Works Under the Hood
When you run a Helm command, Helm does not magically invent new Kubernetes features. Instead, it acts as a smart template engine. It reads your blueprints, injects your variables, builds valid Kubernetes YAML, and sends it straight to the Kubernetes API server.
Helm Chart Rendering & Deployment Pipeline
Helm merges your templates with your environment values, renders standard Kubernetes YAML, and applies it to your cluster while tracking the release version.
4. Writing a Custom Chart & Injecting Variables
Let's build a clean, practical example. Suppose we want to deploy a backend API. First, we define our default variables inside values.yaml.
Example 2: values.yaml (Default variables)
replicaCount: 2
image:
repository: upgradix/order-api
tag: "1.0.0"
service:
port: 8080
Next, we write our Deployment blueprint inside templates/deployment.yaml. Notice how we use double curly braces {{ }} to pull values from values.yaml.
Example 3: templates/deployment.yaml (Injecting variables)
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-api
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-api
template:
metadata:
labels:
app: {{ .Release.Name }}-api
spec:
containers:
- name: order-api
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.service.port }}
Testing your template before deploying
Before touching a live cluster, always run helm template. This renders the YAML right in your terminal so you can verify there are no typos.
Example 4: Dry-run rendering
helm template dev-release ./my-web-api
Expected output
apiVersion: apps/v1
kind: Deployment
metadata:
name: dev-release-api
spec:
replicas: 2
...
containers:
- name: order-api
image: "upgradix/order-api:1.0.0"
ports:
- containerPort: 8080
5. Deploying to Multiple Environments (Overriding Values)
In real-world projects, Production needs more replicas and a different image tag than Development. Instead of editing values.yaml, you create a separate override file called values-prod.yaml.
Example 5: values-prod.yaml
replicaCount: 5
image:
tag: "1.2.0"
Now you deploy to Production using the -f flag. Helm keeps all defaults from values.yaml and only overrides what is listed in values-prod.yaml.
Example 6: Installing with environment overrides
# Deploy using a production values file
helm install prod-api ./my-web-api -f values-prod.yaml
# Or override a single value directly from the command line
helm install qa-api ./my-web-api --set replicaCount=1
--set flags have the highest priority. They will always override both values.yaml and any -f file you pass.6. Deploying Complex Apps (Databases & CI/CD Tools)
You do not have to write Helm charts for popular tools like PostgreSQL, MongoDB, Redis, or Jenkins. Official communities maintain production-ready charts in public repositories (like Bitnami or ArtifactHub).
Here is how you deploy a complete PostgreSQL database with persistent storage and authentication in just two commands:
Example 7: Installing PostgreSQL as a unified package
# 1. Add the Bitnami chart repository
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
# 2. Install PostgreSQL into your cluster
helm install my-database bitnami/postgresql \
--set auth.postgresPassword=SuperSecretPassword123
Expected output
NAME: my-database LAST DEPLOYED: Wed Nov 18 20:35:00 2026 NAMESPACE: default STATUS: deployed REVISION: 1
In seconds, Helm created the StatefulSet, PersistentVolumeClaim, Services, and Secrets required to run PostgreSQL. You can do the exact same thing for CI/CD tools like Jenkins or ArgoCD.
7. Managing Releases: Upgrades & Rollbacks
Every time you install or update a chart, Helm saves a snapshot called a Revision. This makes recovering from a bad deployment effortless.
helm install my-app ./my-web-api. This creates Revision 1.helm upgrade my-app ./my-web-api --set image.tag=2.0.0. This creates Revision 2.helm history my-app.helm rollback my-app 1.values.yaml in Git. Always inject secrets at deployment time through your CI/CD pipeline or use tools like External Secrets Operator or AWS Secrets Manager.8. Hands-On Practice
Run helm create demo-chart on your machine. Change replicaCount to 3 in values.yaml and render the YAML without deploying it.
Hint: Use the helm template command to inspect the output in your terminal.
Create a values-staging.yaml file that changes the service port to 9090 and sets the image tag to staging-latest. Verify that it overrides the default values.yaml.
Expected result: Running helm template with -f values-staging.yaml should output port 9090 while keeping all other default settings intact.
Deploy a chart to a local cluster (like Minikube or Kind) with a valid Nginx image. Then run helm upgrade with a fake image tag like nginx:does-not-exist. Observe the pod failing, then roll it back.
Hint: Use helm history to find the last working revision number and pass it to helm rollback.
9. Helm Charts – Interview Questions
Answer: A Chart is the reusable package or blueprint (the files on disk or in a repository). A Release is a specific running instance of that chart deployed inside a Kubernetes cluster. You can install the same Chart multiple times to create multiple independent Releases (for example, db-dev and db-prod).
Answer: Helm merges values from lowest to highest priority: first the chart's default values.yaml, then any custom files passed via -f (if multiple files are passed, the rightmost file wins), and finally individual parameters passed via --set, which always have the highest priority.
Answer: In Helm 2, Tiller was a server-side component running inside the Kubernetes cluster with broad cluster-admin permissions, which created major security risks. Helm 3 removed Tiller completely. Now, Helm is purely a client-side CLI that uses your existing kubeconfig permissions and Kubernetes RBAC directly.
helm upgrade --install command do in CI/CD pipelines?
Answer: It makes deployments idempotent. If the release does not exist yet in the cluster, Helm installs it. If it already exists, Helm upgrades it. This prevents CI/CD pipelines from failing on the first deployment of a new environment.
Conclusion
Helm transforms Kubernetes from a pile of fragile YAML files into a clean, repeatable package management system. By separating your infrastructure templates from your environment variables, you can deploy the exact same application across Development, Staging, and Production with confidence.
Start by wrapping one of your existing microservices into a simple Helm chart, test it with helm template, and practice upgrading and rolling back. Once you master charts, managing complex databases and cloud-native architectures becomes dramatically simpler.
Official Documentation
- Helm Official Documentation – Getting Started
- Helm Chart Template Developer's Guide
- ArtifactHub – Discover Official Helm Charts
Upgradix by Shrash Studio – Learn Technology. Build Your Future.