DevOps Practitioner · Module 3: Helm and environment configuration
Charts, Templates and Values
A chart is a parameterized bundle of manifests. Templates hold the shape, values fill the blanks, and rendering locally shows exactly what the cluster will receive before anything is installed.
10 min reading
Objectives
- Explain what a chart packages: templates, values and release metadata
- Trace a value from values.yaml through a template into rendered output
- Render a chart locally and read the output before installing anything
- Name what belongs in values versus what belongs in the template
Why this matters
Three environments each keep their own copy of twelve manifests. A label change means editing thirty-six files, and staging drifts from production by accumulation: nobody copied anything wrong, everybody copied at a different time. A chart replaces the copies with one template set plus small per-environment value files. The shape lives once, the differences live in the open, and rendering proves what each environment receives without touching a cluster.
Concepts
A chart carries Chart.yaml (identity and version), values.yaml (defaults), a templates directory (manifests with placeholders) and charts for dependencies. The template language injects values, loops over lists and guards with conditionals; quoting and whitespace control keep YAML valid, which is where beginners bleed time. Values merge in layers: chart defaults, then parent chart values, then user-supplied files, then command-line sets, each layer overriding the last. Knowing the merge order predicts the output; guessing it produces L31-style breakage.
Render before you install, always. The template command prints the exact manifests a release would apply, and diffing rendered output between environments shows the differences as facts rather than assumptions. A chart that cannot render cleanly for every environment is broken in the repo, not in the cluster, and that is the cheapest place to catch it.
Values hold differences, templates hold shape. Image tags, replica counts, resource requests and hostnames differ per environment and belong in values. Control flow, required blocks and structural defaults belong in templates. A value that changes the shape of the output (toggling whole resources) deserves a condition with a default, not a forked chart.
Worked example
A demo chart deploys the M09 web service with values for dev and staging: different replica counts, different hosts, same templates. The learner renders both, diffs them, and quotes the three lines that differ. Then a deliberate wrong-type value (a string where a number belongs) breaks rendering with a template error, fixed in the values file, never in the template.
Common wrong move
Forking the chart per environment when values diverge. Two charts drift like the thirty-six files did, and the merge order that was supposed to help now confuses because each fork merges differently. One chart, many value files; fork only when the shape itself truly differs.
Quick check
An optional 4-question self-check. Answers never leave your device, are not stored, and never count toward any assessment.
Lesson feedback
No published feedback yet.
Log in and complete the lesson to leave feedback.
Exercise
Render a demo chart for two environments from one template set, diff the outputs, and quote the lines that differ plus the values that produced them.
Pass criteria
The record shows both rendered outputs, the diff lines, and the value entries responsible, with one template set for both.