Courseiva

CKAD Application Design and Build Practice Question

Which of the following commands creates a deployment named 'webapp' that runs the image 'nginx:1.25' with 3 replicas?

⚠ Common exam trap

The temptation is to choose an option that looks similar to the correct one, but pay close attention to the missing flags and the command verb.

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 create deployment webapp --image=nginx:1.25 --replicas=3

The correct command to create a Deployment named 'webapp' with the nginx:1.25 image and 3 replicas is 'kubectl create deployment webapp --image=nginx:1.25 --replicas=3'. Option B uses 'kubectl run', which creates a Pod, not a Deployment, and does not support the --replicas flag in modern Kubernetes. Option C is missing the --replicas flag, so it creates a Deployment with only the default of 1 replica. Option D uses 'kubectl expose', which creates a Service, not 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 create deployment webapp --image=nginx:1.25 --replicas=3

    Why this is correct

    kubectl create deployment webapp --image=nginx:1.25 --replicas=3 is the canonical imperative command that generates a Deployment named 'webapp' with the specified container image and desired replica count. The --replicas flag is explicitly supported by kubectl create deployment, and the resulting Deployment object will manage three Pod replicas using the nginx:1.25 image. This fully satisfies the requirement to create a Deployment with those parameters.

  • ✗

    kubectl run webapp --image=nginx:1.25 --replicas=3

    Why it's wrong here

    kubectl run webapp --image=nginx:1.25 --replicas=3 is invalid because kubectl run does not accept a --replicas flag—it creates a single Pod (or with --restart=Always, a Deployment in older versions, but modern kubectl creates a Pod by default). Even if the flag were ignored, kubectl run would create a Pod named 'webapp', not a Deployment, so the command cannot be the correct answer for creating a Deployment with three replicas.

  • ✗

    kubectl create deployment webapp --image=nginx:1.25

    Why it's wrong here

    kubectl create deployment webapp --image=nginx:1.25 does create a Deployment named 'webapp', but without the --replicas flag it defaults to exactly one replica. While this command is correct in syntax, it fails to satisfy the implicit requirement (as seen in the correct option) of creating a Deployment with three replicas. The absence of --replicas=3 makes it incomplete, not wrong in kind—it creates a Deployment but with the wrong scale.

  • ✗

    kubectl expose deployment webapp --port=80

    Why it's wrong here

    kubectl expose deployment webapp --port=80 only creates a ClusterIP Service that targets the existing Deployment's selector; it does not create or modify the Deployment itself. While the Service is a valid way to expose pods, the question asks which command 'creates a deployment,' so this command fails the core requirement—no Deployment object is generated.

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.