Comments and Quoting in Templates
Template comments and the quote helper.
Comments and Quoting in Templates is a free Helm Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Helm Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Two Kinds of Comments
A chart has two ways to leave notes: plain YAML comments and special template comments. They behave very differently at render time.
YAML Comments Survive
A line starting with a hash is a normal YAML comment. It passes straight through and stays in the rendered output for anyone to read.
# this note appears in the final manifestTemplate Comments Vanish
Helm has its own comment that disappears entirely. Wrap text in {{/* */}} and the engine strips it before output.
{{/* this note is removed at render time */}}Why Two Styles
Use a hash to document the deployed YAML. Use a template comment for notes about the template logic that users should never see. 📝
Comment Out an Action
Template comments are handy for disabling code. Wrap an action in {{/* */}} and Helm skips it, no rendering, no errors.
Now for Quoting
YAML often guesses types. The value 1.10 may become 1.1, and yes may turn into true. Quoting forces a clean string instead.
The quote Function
Helm ships a quote function that wraps a value in double quotes for you, so the rendered field is unambiguously a string.
tag: {{ quote .Values.image.tag }}Quote as a Pipe
You will usually see quote written as a pipe at the end of an action. It reads naturally: take the value, then quote it.
tag: {{ .Values.image.tag | quote }}Why Quoting Matters
Without quotes a version like 1.20 can silently lose its trailing zero and become 1.2, breaking your image reference. Quoting prevents that. ⚠️
Numbers Need quote Too
Kubernetes sometimes wants a number kept as text, like a port in an annotation. Piping through quote keeps it a string safely.
Manual Quotes Are Fine
You can also write literal quotes yourself in YAML. The quote function just does it programmatically when the value comes from a template.
port: "{{ .Values.port }}"Quick Check
You add a note that should not appear in the deployed YAML.
Recap
You can now hide notes with {{/* */}}, keep visible ones with a hash, and force clean strings using the quote function. 🎯
Frequently asked questions
Is the “Comments and Quoting in Templates” lesson free?
Yes — the full text of “Comments and Quoting in Templates” is free to read here on the web, and the Helm Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Helm Academy course, upgrade to CoddyKit PRO.
What will I learn in “Comments and Quoting in Templates”?
Template comments and the quote helper. You practise Helm Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Helm Academy?
No prior experience is required. Helm Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Comments and Quoting in Templates” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Helm Academy lesson?
Yes. Every Helm Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Double-Brace Action Syntax
- Trimming Whitespace with Dash Markers
- Comments and Quoting in Templates
- Common YAML Indentation Traps