Courseiva
Application Deployment →mediumMultiple Choice

CKAD Application Deployment Practice Question

A Helm chart has the following template snippet: '{{ .Values.replicaCount }}'. You want to set replicaCount to 5 during installation. Which command should you use?

⚠ Common exam trap

It's easy for candidates to confuse `--set` with `--values` or mistakenly use deprecated `--name` syntax from Helm v2, but the CKAD exam tests Helm v3 where `--set` is the correct flag for inline value overrides.

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

✓

helm install my-release mychart --set replicaCount=5

The `--set` flag in Helm allows you to directly override a single value in a chart's `values.yaml` file from the command line. This is the standard way to set `replicaCount` to 5 during installation without modifying the chart or using a separate values file.

Answer analysis

Option-by-option breakdown

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

  • ✗

    helm install my-release mychart --name replicaCount=5

    Why it's wrong here

    The `--name` flag is not a valid option for overriding chart values; in Helm 3, the release name is a positional argument and `--name` is not recognized at all. Historically, Helm 2 used `--name` to set the release name, but here the release name is already provided as `my-release`, so passing `--name replicaCount=5` would either throw a flag error or attempt to rename the release, not alter the `replicaCount` value. The proper flag for direct value overrides is `--set`.

  • ✗

    helm install my-release mychart --values replicaCount=5

    Why it's wrong here

    The `--values` (or `-f`) flag is designed to accept a file path to a YAML or JSON values file, not a `key=value` pair. When you write `--values replicaCount=5`, Helm interprets `replicaCount=5` as a filename and fails with a "no such file" error because no such file exists. For in-line overrides of individual values, use `--set` or `--set-string` (the latter only when you need a string); `--values` is intended for bulk overrides stored in a file.

  • ✓

    helm install my-release mychart --set replicaCount=5

    Why this is correct

    Using `--set replicaCount=5` is the correct and idiomatic way to override a single chart value from the CLI. Helm parses the value using YAML type inference, so `5` is interpreted as an integer, which aligns with the expected type for a Deployment's `replicas` field. This avoids the need to create a separate values file and gives the highest precedence among value sources, taking precedence over the chart's default `values.yaml` and any `-f` files. The `--set` flag also supports comma-separated key/value pairs and complex structures with dots.

  • ✗

    helm install my-release mychart --set-string replicaCount=5

    Why it's wrong here

    The `--set-string` flag forces the provided value to be interpreted as a string, which is not appropriate for `replicaCount` if the chart expects an integer. Passing `--set-string replicaCount=5` would result in the template receiving `"5"` (a string) instead of `5` (a number), potentially causing Kubernetes API validation errors because fields like `spec.replicas` require an integer. This flag is useful only when a chart expects a string value, such as an annotation or a tag, and the default type inference would otherwise convert it to a number or boolean; in this case, `--set` is the correct choice.

About these practice questions

Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKAD 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 CKAD exam.