Package an Application as a Helm Chart
What you'll build
A reusable Helm Chart that deploys a web application with configurable replica count, image tag, and service type.
Goals
- Understand Helm Chart structure
- Create templates for Deployment and Service
- Write a values.yaml with configurable parameters
- Install and upgrade the Chart
Prerequisites
- Helm installed
- A Kubernetes cluster
- Basic understanding of Kubernetes manifests
Steps
- 1
Create the Chart scaffold
Use
helm createto generate the Chart directory structure with default templates.Codehelm create my-app-chart cd my-app-chartExpected result
A Chart directory is created with templates/, values.yaml, and Chart.yaml.
- 2
Customize values.yaml
Edit values.yaml to define configurable parameters: replicaCount, image repository and tag, service type and port.
CodereplicaCount: 2 image: repository: nginx tag: "1.25" service: type: ClusterIP port: 80Expected result
values.yaml is customized with the parameters you want to make configurable.
- 3
Review and customize templates
Look at templates/deployment.yaml and templates/service.yaml. They use Go template syntax to reference values from values.yaml. Customize them if needed.
Expected result
You understand how templates reference values using {{ .Values.xxx }} syntax.
- 4
Install and test the Chart
Install the Chart with default values, then upgrade it with a custom value to see how Helm applies changes.
Codehelm install my-release . # Upgrade with custom replica count helm upgrade my-release . --set replicaCount=5 # Verify kubectl get podsExpected result
The application is deployed with 2 replicas, then upgraded to 5 replicas.
- 5
Add a health check endpoint
Add a /health endpoint returning 200 OK for orchestration systems (Kubernetes, load balancers) to probe liveness. Health checks are foundational for production deployment.
Code# app.py (Flask example) from flask import Flask, jsonify app = Flask(__name__) @app.route("/health") def health(): return jsonify({"status": "ok"}), 200 @app.route("/ready") def ready(): # Check DB connection etc. return jsonify({"ready": True}), 200Expected result
curl localhost:5000/health returns {"status":"ok"} with a 200 status code.
Try it yourself
What you learned
You created a Helm Chart that packages a Kubernetes application with configurable values. Helm Charts make it easy to share, version, and deploy applications consistently.
Related Resources
Related Glossary
- Helm
Kubernetes package manager
Related Glossary
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
- Helm
Kubernetes package manager
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.