Courseiva
Application Deployment →easyMultiple Choice

CKAD Application Deployment Practice Question

Which of the following is the correct way to scale a Deployment named 'api' to 5 replicas using kubectl?

⚠ Common exam trap

Candidates often confuse `kubectl scale` with other imperative commands like `kubectl set` or incorrectly assume positional arguments work for the replica count, leading them to choose options that resemble valid but non-existent syntax.

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

✓

kubectl scale deployment api --replicas=5

`kubectl scale deployment api --replicas=5` is the standard kubectl command to change the replica count of a Deployment. The `scale` subcommand directly modifies the `.spec.replicas` field in the Deployment's manifest, instructing the ReplicaSet controller to adjust the number of Pods to match the desired count.

Answer analysis

Option-by-option breakdown

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

  • ✓

    kubectl scale deployment api --replicas=5

    Why this is correct

    The `kubectl scale` command is the canonical Kubernetes imperative operation for altering the desired replica count of a resource. Using `deployment api --replicas=5` explicitly identifies the resource type and name while supplying the target count through the mandatory `--replicas` flag. This triggers the scale subresource of the Deployment, updating its `spec.replicas`, and the corresponding ReplicaSet controller then adjusts pods to match. This syntax is correct because every required argument is provided and no invalid flags are used.

  • ✗

    kubectl scale deploy api 5

    Why it's wrong here

    While `deploy` is an accepted short form for `deployment`, this command is invalid because the replica target is passed as a positional argument (`5`) rather than through the `--replicas` flag. `kubectl scale` requires the desired number of replicas to be explicitly specified with `--replicas`; without it, the command cannot determine the new scale and will fail with a usage error. The correct invocation would be `kubectl scale deploy api --replicas=5`. Thus, this option is wrong solely because the replica count is misplaced, even though the resource type shorthand is valid.

  • ✗

    kubectl update deployment api --replicas=5

    Why it's wrong here

    `kubectl update` is not a recognized kubectl subcommand at all, so this entire command is invalid. The `kubectl` CLI does not provide a generic `update` verb; mutating an existing resource imperatively is done via `kubectl scale`, `kubectl set`, `kubectl edit`, `kubectl patch`, or `kubectl apply`. Even if a similar command existed, scaling requires the `scale` subcommand rather than a generic update verb, and the target count would still need `--replicas`. Consequently, executing this results in an unknown-command error, not a scale operation.

  • ✗

    kubectl set replicas deployment api 5

    Why it's wrong here

    Although `kubectl set` is a valid command, it has no `replicas` subcommand; its available subcommands are limited to `env`, `image`, `resources`, `selector`, `serviceaccount`, and `subject`. Scaling is performed exclusively with `kubectl scale`, not with `kubectl set`. Additionally, even if a `replicas` subcommand existed, passing `5` positionally would be incorrect because the target count must be supplied via the `--replicas` flag. This option fails both because the subcommand is nonexistent and because the argument syntax does not match kubectl's imperative scaling interface.

About these practice questions

One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.