0
0
Kubernetesdevops~30 mins

Creating custom Helm charts in Kubernetes - Try It Yourself

Choose your learning style9 modes available
Creating custom Helm charts
📖 Scenario: You are working as a DevOps engineer for a small company. You need to package a simple web application into a Helm chart so it can be easily deployed and managed on Kubernetes clusters.
🎯 Goal: Build a custom Helm chart for a basic web application with configurable image and replica count.
📋 What You'll Learn
Create the Helm chart directory structure with Chart.yaml and values.yaml
Add a configuration variable for the number of replicas
Write the deployment template using Helm template syntax
Output the rendered Kubernetes deployment manifest
💡 Why This Matters
🌍 Real World
Helm charts help package and deploy applications on Kubernetes clusters easily and consistently.
💼 Career
Knowing how to create custom Helm charts is a key skill for DevOps engineers managing Kubernetes deployments.
Progress0 / 4 steps
1
Create Helm chart metadata
Create a file named Chart.yaml with the following content exactly:
apiVersion: v2
name: simple-webapp
version: 0.1.0
Kubernetes
Need a hint?

The Chart.yaml file defines the chart's metadata. Use exact keys and values as shown.

2
Add default values configuration
Create a file named values.yaml with these exact entries:
replicaCount: 2
image:
repository: nginx
tag: stable
Kubernetes
Need a hint?

The values.yaml file holds default settings for your chart. Indentation matters in YAML.

3
Write deployment template using Helm syntax
Create a file named templates/deployment.yaml with a Kubernetes Deployment manifest that uses Helm template syntax to:
- Set replicas to {{ .Values.replicaCount }}
- Set container image to {{ .Values.image.repository }}:{{ .Values.image.tag }}
- Name the deployment {{ .Chart.Name }}
Kubernetes
Need a hint?

Use double curly braces {{ }} to insert values from values.yaml and chart metadata.

4
Render and output the Helm template
Run the Helm template command to render the deployment manifest and print the output exactly:
helm template simple-webapp .
Kubernetes
Need a hint?

Use the helm template command in your terminal inside the chart directory to see the rendered Kubernetes manifest.