0
0
Kubernetesdevops~30 mins

Chart templates and values.yaml in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Create a Helm Chart with Templates and values.yaml
📖 Scenario: You are working as a DevOps engineer. Your team wants to deploy a simple web application using Helm charts on Kubernetes. You need to create the basic Helm chart files: a values.yaml file to hold configuration values and a template file to use those values.
🎯 Goal: Build a Helm chart with a values.yaml file containing application settings and a template file that uses these values to generate a Kubernetes Deployment manifest.
📋 What You'll Learn
Create a values.yaml file with specific keys and values
Create a template file deployment.yaml that uses values from values.yaml
Use Helm template syntax to insert values
Output the final rendered Deployment manifest
💡 Why This Matters
🌍 Real World
Helm charts are widely used to package, configure, and deploy applications on Kubernetes clusters in a repeatable way.
💼 Career
Understanding Helm charts and how to use <code>values.yaml</code> and templates is essential for DevOps engineers working with Kubernetes deployments.
Progress0 / 4 steps
1
Create the values.yaml file
Create a values.yaml file with these exact entries:
appName: myapp
replicaCount: 3
image:
repository: nginx
tag: stable
Kubernetes
Need a hint?

The values.yaml file holds configuration values in YAML format. Use indentation for nested keys like image.repository.

2
Create the deployment.yaml template
Create a Helm template file named deployment.yaml that starts with apiVersion: apps/v1 and kind: Deployment. Use the value .Values.appName for metadata.name and spec.replicas. Use .Values.image.repository and .Values.image.tag for the container image.
Kubernetes
Need a hint?

Use double curly braces {{ }} to insert values from values.yaml in the template.

3
Render the Helm template
Write a command to render the Helm template using helm template with the current directory as the chart location.
Kubernetes
Need a hint?

The helm template . command renders the templates in the current directory without installing them.

4
Display the rendered Deployment manifest
Run the helm template . command and print the output to show the rendered Kubernetes Deployment manifest.
Kubernetes
Need a hint?

Use Python's subprocess module to run the helm template . command and print the output.