Chapter 85: Helm for Kubernetes
85.3 Chart layout — Chart.yaml, values, templates
Story. A Capgemini-style team in Chennai handed Arjun a folder named payments. Inside he found Chart.yaml, values.yaml and templates/deployment.yaml. That three-part layout is the whole mental model: metadata, knobs, and rendered YAML.
Why
Without a fixed layout, every engineer invents a different folder mess. Charts stay reviewable in Git.
What
- Chart.yaml — Name, version, appVersion, description.
- values.yaml — Default values.
- templates/ — Files with
{{ }}placeholders. - charts/ — Optional dependent charts.
- .helmignore — Files skipped when packaging.
How
helm create hello-web
ls hello-web
Output
Chart.yaml charts templates values.yaml
What it shows: helm create scaffolds a working chart you can edit.
Example 1: Chart.yaml lines
apiVersion: v2
name: hello-web
description: Tiny web chart for class
type: application
version: 0.1.0
appVersion: "1.0.0"
What each line does
apiVersion: v2— Helm 3 chart API.name— Chart name.version— Chart version (SemVer). Bump when templates change.appVersion— The app version the chart installs (informational).
Example 2: values driving a template
# values.yaml
replicaCount: 2
image:
repository: nginx
tag: "1.27-alpine"
# templates/deployment.yaml (excerpt)
spec:
replicas: {{ .Values.replicaCount }}
containers:
- name: web
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Ravindra Bagale's Tip
Bump chart version when you change templates; bump appVersion when you change the default image tag.
templates बदलल्यावर chart version वाढवा; default image tag बदलल्यावर appVersion वाढवा.
templates बदलें तो chart version बढ़ाएं; default image tag बदलें तो appVersion बढ़ाएं.
Quick quiz
Q1. Which file holds default knobs?
values.yaml
Q2. Where do Deployments and Services live?
Under templates/
Q3. What does helm create do?
Scaffolds a new chart folder.
Did you understand? Let us try it once more.