Courseiva
Application Deployment →easyMultiple Choice

CKAD Application Deployment Practice Question

You need to scale a Deployment named 'api' to 10 replicas instantly. Which command should you use?

⚠ Common exam trap

It's easy for candidates to confuse `kubectl autoscale` (which creates an HPA for dynamic scaling) with `kubectl scale` (which performs an immediate, static replica change), or they may invent a non-existent command like `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 api --replicas=10

`kubectl scale` is the dedicated imperative command to change the replica count of a Deployment instantly. It directly updates the `spec.replicas` field in the Deployment's desired state, causing the controller to immediately create or terminate Pods to match the new 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 autoscale deployment api --min=10 --max=10

    Why it's wrong here

    The `kubectl autoscale` command creates a HorizontalPodAutoscaler (HPA) object, which continuously adjusts replica counts based on observed CPU/memory metrics rather than performing a one-time scaling action. Even with `--min=10 --max=10`, it only sets the HPA bounds and requires a metrics server to be running; it does not imperatively scale the Deployment to exactly 10 replicas at once. Thus, it is not the correct way to directly scale a Deployment.

  • ✗

    kubectl patch deployment api -p '{"spec":{"replicas":10}}'

    Why it's wrong here

    While `kubectl patch` can modify the Deployment's `spec.replicas` field to 10, this is a lower-level, imperative alternative that requires you to manually craft a JSON patch. The canonical and clearest command for changing replica counts is `kubectl scale`, which is purpose-built for this task. For simple replica adjustments, `kubectl scale` is the recommended, direct, and more readable approach, so this option is valid but not the simplest or most appropriate.

  • ✗

    kubectl resize deployment api --replicas=10

    Why it's wrong here

    There is no `resize` subcommand in the `kubectl` CLI. Running `kubectl resize` will fail immediately with an unknown command error because Kubernetes does not implement a `resize` verb for Deployments. To change the replica count, you must use `kubectl scale` (or alternatively `kubectl patch`), but `resize` simply does not exist as a valid kubectl operation.

  • ✓

    kubectl scale deployment api --replicas=10

    Why this is correct

    The `kubectl scale deployment api --replicas=10` command is the standard, imperative way to directly change the replica count of a Deployment. It updates the Deployment's desired state to 10 replicas, causing the ReplicaSet controller to create or remove Pods until the actual count matches the desired count. This command is explicit, concise, and explicitly designed for scaling resources, making it the correct answer.

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.