Kubernetes Deployment Using Helm — A Complete Beginner-Friendly Guide
Deploying applications directly with raw Kubernetes YAML files quickly becomes repetitive and error-prone.
This is exactly where Helm helps — a package manager for Kubernetes that simplifies deployments, promotes reusability, and standardizes configurations.
In this blog, we’ll understand:
-
What is Helm?
-
Helm chart folder structure
-
How templates work
-
How
values.yamlmakes your deployment configurable -
Deployment + Service example for a backend API
-
Helm commands to deploy your application
🧭 1. What Is Helm?
Helm is Kubernetes’s package manager, similar to:
-
apt (Ubuntu)
-
yum (CentOS)
-
Homebrew (macOS)
A Helm chart packages all Kubernetes YAML files into a reusable structure.
Instead of maintaining multiple YAMLs per environment (dev, QA, prod), Helm allows:
✔ Configuration overrides
✔ Templates
✔ Versioning
✔ Easy upgrades (helm upgrade)
✔ One-line deployment
🗂️ 2. Helm Chart Structure Explained
When you create a Helm chart using:
Helm generates the following structure:
🧩 3. Key Components Inside the Chart
✔ Chart.yaml
Metadata about the chart:
✔ values.yaml
All environment-specific configuration goes here.
Example:
You will override these per environment (dev/prod).
🛠️ 4. Templates — How Helm Injects Values
Inside templates/deployment.yaml, Helm uses Go template syntax:
Helm replaces {{ ... }} during deployment.
🌐 5. Service (Expose Your Endpoint)
If your backend API runs on http://service:8080/api/v1/hello,
you need a Kubernetes Service.
Example service.yaml:
This exposes your API internally inside the cluster.
🌍 6. Optional: Ingress (Expose to Internet)
If you want the service available via a domain like:
You need an ingress:
📝 7. How to Deploy the Service Using Helm
1. Create your chart
2. Update values.yaml
Your image, port, replicas, env variables.
3. Deploy to Kubernetes
4. Upgrade after modifying values
5. Uninstall
📦 8. Passing Environment-Specific Values
dev-values.yaml
prod-values.yaml
Deploy using:
🧱 9. How the Application Endpoint Is Exposed
Let’s say your application exposes:
Then:
-
Container exposes → 8080
-
Deployment uses → containerPort: 8080
-
Service exposes → port: 8080
-
Ingress exposes → domain route
Flow:
🧭 10. Text Diagram — Deployment Flow
🎯 Summary
| Concept | Description |
|---|---|
| Helm | Package manager for Kubernetes |
| Chart | Folder containing Kubernetes templates |
| values.yaml | Environment-specific variables |
| deployment.yaml | Deploy your app container |
| service.yaml | Exposes your app to the cluster |
| ingress.yaml | (Optional) Public access endpoint |
👍 Final Thoughts
Helm makes Kubernetes deployments:
✔ Consistent
✔ Repeatable
✔ Versioned
✔ Easy to override for multiple environments
You only maintain one chart, and override the configuration for dev/staging/prod.
No comments:
Post a Comment