Courseiva

KCNA Cloud Native Application Delivery Practice Question

A team manages a multi-service application with Helm. Each service has its own ConfigMap, Deployment, and Service. The manifests for all services are almost identical except for the image tag and service name. They want to create a single reusable Helm chart that deploys all services from one values file, avoiding duplicate YAML. Which Helm feature should they use to loop over a list of services in the chart templates?

⚠ Common exam trap

A common mix-up: candidates confuse Helm's templating loop with chart dependencies or named templates, which are for different reuse patterns and do not generate multiple resources from a single list.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use the `range` action in the template to iterate over a list defined in values.yaml, rendering one set of resources per service.

The `range` action in Helm templates allows iteration over a list from values.yaml, rendering a block of resources for each item. This is the standard way to avoid duplicating YAML for near-identical services. By defining a list of services in values.yaml and using `range` in the templates, the chart generates all ConfigMaps, Deployments, and Services dynamically. This keeps the chart DRY and maintainable as services are added.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use Helm's `--set` flag during installation to override the service name and image tag for each service.

    Why it's wrong here

    The `--set` flag overrides values at install time, but it does not create multiple resources from a single template. You would need to run `helm install` multiple times with different `--set` values, which is not a single reusable chart deployment. The goal is to render all services from one chart and one values file, not to perform repeated installs. This approach also makes tracking releases more complex.

  • ✗

    Create a separate subchart for each service and include them with the `dependencies` field in Chart.yaml.

    Why it's wrong here

    Subcharts are useful for packaging reusable components, but creating one subchart per service defeats the goal of a single reusable chart. Each subchart would still need its own templates and values, reintroducing duplication. Dependencies in Chart.yaml are for sharing chart logic across teams, not for looping over a list of near-identical services inside one chart. This approach increases maintenance overhead rather than reducing it.

  • ✗

    Define each service as a separate named template in `_helpers.tpl` and call them from a single deployment manifest.

    Why it's wrong here

    Named templates in `_helpers.tpl` are for reusable snippets like labels or full resource blocks, but they do not automatically generate multiple resources from a list. You would still need to invoke each named template individually, which does not scale when services are added. The `range` action is designed to iterate over data, whereas named templates are for static reuse. This method does not achieve dynamic generation from one values file.

  • ✓

    Use the `range` action in the template to iterate over a list defined in values.yaml, rendering one set of resources per service.

    Why this is correct

    The `range` action in Helm templates iterates over a collection, such as a list of service definitions in values.yaml, and renders the enclosed template block for each item. This eliminates duplicate YAML by generating ConfigMap, Deployment, and Service resources dynamically. The values file supplies per-service data like name and image tag, and the chart templates reference those values with `.` inside the loop, producing one set of manifests per service entry.

About these practice questions

This KCNA question is part of Courseiva's 930-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CNCF exam blueprint

This KCNA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the KCNA exam.