Parameterizing the Container Image
Wiring image repository and tag to values.
Parameterizing the Container Image is a free Helm Academy lesson on CoddyKit — lesson 2 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.
Why Parameterize the Image
A hard-coded image locks every user to one version. Wiring the image to values lets people pick the repository and tag they need.
Split Repository and Tag
By convention charts store the image as two fields: a repository and a tag. Keeping them separate makes version bumps clean.
# values.yaml
image:
repository: nginx
tag: "1.27"Read Nested Values
Reach nested keys by chaining dots. Here .Values.image.repository walks into the image map you just defined.
image: {{ .Values.image.repository }}Join Repository and Tag
An image reference is repository, then a colon, then tag. Build it inside the template so the rendered line is a single valid string.
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"Always Quote the Tag
A tag like 1.27 can be read as a number by YAML. Quote tags in values so they stay strings and never lose a trailing zero.
tag: "1.27.0"Provide a Sensible Default Tag
The default function supplies a fallback when a value is empty. A common pattern uses the chart's appVersion as the default tag.
{{ .Values.image.tag | default .Chart.AppVersion }}Expose the Pull Policy
Let users control when Kubernetes re-pulls an image by parameterizing imagePullPolicy too. IfNotPresent is a safe default.
imagePullPolicy: {{ .Values.image.pullPolicy }}Default the Pull Policy
Set the pull policy default in values.yaml so an install works with zero overrides. Users still change it whenever they need to.
image:
pullPolicy: IfNotPresentThe Full Container Block
Now your container is fully data-driven: image and pull policy both flow from .Values.image, with no literals left in the template.
containers:
- name: app
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}Override at Install Time
Users tweak a single nested value with --set. Dots in the key map straight onto your values tree, no file edits required.
helm install web . --set image.tag=1.28Confirm the Rendered Image
Render with an override to prove the wiring works end to end. The output should show your chosen tag in the image line.
helm template web . --set image.tag=1.28Quick Check
You want to install with a different image tag without editing files. What works?
Recap: A Configurable Image
You split the image into repository and tag, added a pull policy, and let users override each with --set. Quote tags to stay safe.
Frequently asked questions
Is the “Parameterizing the Container Image” lesson free?
Yes — the full text of “Parameterizing the Container Image” 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 “Parameterizing the Container Image”?
Wiring image repository and tag to values. 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 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Parameterizing the Container Image” 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
- A Minimal Deployment Template
- Parameterizing the Container Image
- Adding a Service Template
- Installing and Iterating Your Chart