Courseiva
Application Deployment →easyMultiple Choice

CKAD Application Deployment Practice Question

Which command scales a Deployment named 'web' to 5 replicas?

⚠ Common exam trap

Candidates often confuse `kubectl scale` (which sets a static replica count) with `kubectl autoscale` (which creates an HPA for dynamic scaling), or they invent non-existent commands like `kubectl set replicas` or `kubectl resize`.

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 web --replicas=5

The correct command to scale a Deployment to a specific number of replicas is `kubectl scale deployment web --replicas=5`. This command directly modifies the `spec.replicas` field of the Deployment object, instructing the Kubernetes controller manager to adjust the number of running 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 set replicas deployment web 5

    Why it's wrong here

    The `kubectl set` command modifies existing resource fields, but only for certain attributes like `image` or `resources`; it has no `replicas` subcommand. Even if a `set` subcommand existed, scaling is a separate operation handled by `kubectl scale`, and the replica target must be passed with the `--replicas=` flag rather than as a bare positional argument.

  • ✓

    kubectl scale deployment web --replicas=5

    Why this is correct

    This is the canonical imperative command to manually change the DesiredReplicas field of a deployment. `kubectl scale` works on deployments, replication controllers, replica sets, and stateful sets, and the `--replicas=` flag explicitly sets the target count. It is the correct way to immediately scale a deployment without altering any other spec.

  • ✗

    kubectl resize deployment web --replicas=5

    Why it's wrong here

    `kubectl resize` is not a recognized kubectl subcommand at all; it does not exist in the kubectl API. While 'resize' might appear in other orchestration tools, Kubernetes uses the verb 'scale' to both noun and verb for changing pod count. Running this yields an error for unknown command, so it cannot affect the deployment.

  • ✗

    kubectl autoscale deployment web --replicas=5

    Why it's wrong here

    `kubectl autoscale` is a valid command but it creates a HorizontalPodAutoscaler (HPA) that adjusts replicas automatically based on CPU or custom metrics, not a one-time manual scaling. The flags for `autoscale` are `--min` and `--max`, not `--replicas`, so this invocation would fail or create an HPA with unintentional parameters rather than setting the deployment to exactly 5 replicas.

About these practice questions

This CKAD question is part of Courseiva's 826-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 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.