Kubernetes Deployment Using Helm — A Complete Beginner-Friendly Guide
When deploying applications to Kubernetes, engineers quickly face challenges:
-
Too many YAML files
-
Repeated configurations across environments
-
Manual updates during releases
-
Hard-to-maintain deployments
Helm solves all of these.
Helm is the package manager for Kubernetes that allows you to deploy applications using reusable, templated, and version-controlled charts.
In this guide, we’ll learn:
-
What Helm is
-
Why Helm is used
-
Helm chart folder structure
-
How Deployment, Service, and Ingress work together
-
How to write Helm templates
-
How to deploy a service using Helm
Let’s get started.
1. What Is Helm?
Helm is a package manager for Kubernetes — similar to apt, yum, or Homebrew.
A Helm chart contains all the Kubernetes YAML files (Deployment, Service, Ingress, ConfigMaps, etc.) packaged into a single reusable template.
✔ Helm solves real problems:
| Problem | Helm Solution |
|---|---|
| Too many YAML files | One reusable chart |
| Duplicate configs across environments | values.yaml overrides |
| Manual edits | Template-based automation |
| Risky updates | Versioned upgrades (helm upgrade) |
Instead of maintaining dozens of YAML files, you maintain only one chart + environment-specific values.
2. Helm Chart Folder Structure
When you run:
Helm generates this structure:
Let’s break these down.
3. Key Files Explained
✔ Chart.yaml
Metadata about the service:
✔ values.yaml
This file holds your environment-specific configuration.
You can override these for dev, QA, prod using:
4. Deployment — Template Example
templates/deployment.yaml uses Helm templating:
Helm replaces {{ ... }} placeholders with values during installation.
5. Service — Internal Load Balancer
service.yaml exposes the Pods inside the cluster:
This allows other services inside the cluster to reach your API.
6. Ingress — External Access
If you want the service accessible from the internet:
Ingress uses an Ingress Controller (NGINX, Traefik, AWS ALB) to route HTTP/HTTPS traffic.
7. How Deployment, Service, and Ingress Are Connected
This is one of the most important concepts and often misunderstood.
Connection Breakdown
| Component | Role |
|---|---|
| Deployment | Creates and manages Pods |
| Service | Maps stable IP to Pods & load balances |
| Ingress | Maps external domain/path to Service |
Flow Diagram
Detailed Flow Description
-
Deployment creates Pods with label:
-
Service selects Pods using:
-
Ingress forwards external HTTP traffic to the Service:
Text Diagram
8. Installing the Helm Chart
Install
Upgrade
Uninstall
9. Using Environment-Specific Overrides
dev-values.yaml
prod-values.yaml
Deploy:
Conclusion
Helm is an essential tool for real-world Kubernetes deployments.
It simplifies your deployment workflow by providing:
✔ Reusable templates
✔ Environment-specific configurations
✔ Clean separation of logic and values
✔ Version-controlled releases
✔ Easy upgrades and rollbacks
No comments:
Post a Comment