Courseiva
Application Deployment →easyMultiple Choice

CKAD Application Deployment Practice Question

Which kubectl command sets the number of replicas for a deployment named 'nginx' to 5?

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

kubectl scale is the correct command to change the replica count of a deployment.

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 update deployment nginx --replicas=5

    Why it's wrong here

    The verb 'update' is not a recognized kubectl command; kubectl does not have an 'update' subcommand for modifying resource attributes. Changing a Deployment's replica count requires either the dedicated 'kubectl scale' command or editing the manifest with 'kubectl edit' or 'kubectl patch'. Running 'kubectl update deployment nginx --replicas=5' would immediately fail with an error about an unknown command, so this option cannot set replicas.

  • ✓

    kubectl scale deployment nginx --replicas=5

    Why this is correct

    kubectl scale deployment nginx --replicas=5 is the correct command because the scale subcommand directly adjusts the desired replica count for a Deployment, updating spec.replicas in the live object. It also accepts optional flags like --current-replicas to perform optimistic concurrency checks and --timeout to wait for the scale operation to complete. This is the standard imperative way to resize a Deployment's pod count in Kubernetes.

  • ✗

    kubectl set scale deployment nginx --replicas=5

    Why it's wrong here

    While 'kubectl set' is a valid verb, it only supports specific subcommands such as 'image', 'env', 'resources', and 'serviceaccount'; 'scale' is not one of them. Combining 'set' with 'scale' creates an invalid subcommand path, and kubectl would reject it as an unknown command. The correct command is simply 'kubectl scale', which is its own top-level verb not a child of 'set'.

  • ✗

    kubectl resize deployment nginx --replicas=5

    Why it's wrong here

    The word 'resize' is not part of kubectl's command vocabulary; Kubernetes uses 'scale' to describe changing the number of replicas, not 'resize'. This reflects a common misconception from other container orchestration systems, but kubectl has no 'resize' subcommand for any resource type. Invoking 'kubectl resize deployment nginx --replicas=5' would return an unknown command error, making it impossible to set the replica count.

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.