KCNA Container Orchestration Practice Question
Which command is used to create a Deployment that runs an nginx container with 3 replicas?
⚠ Common exam trap
Test-takers frequently confuse `kubectl run` (which creates a pod, not a deployment with replicas) with `kubectl create deployment`, or they mistakenly think `kubectl scale` can create a deployment, when it only modifies an existing one.
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 nginx --image=nginx --replicas=3
`kubectl create deployment` is the standard Kubernetes command to create a Deployment resource, and the `--replicas=3` flag directly sets the desired replica count to 3. This command creates a Deployment that manages a ReplicaSet to ensure three nginx pods are running and maintained.
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 pod nginx --image=nginx --replicas=3
Why it's wrong here
kubectl create pod creates a bare Pod, and --replicas is invalid for that subcommand, so no Deployment or replica set is produced. It is tempting for simple single-Pod tests, but Deployments require kubectl create deployment or an applied manifest.
- ✗
kubectl run nginx --image=nginx --replicas=3
Why it's wrong here
kubectl run creates a single Pod, not a Deployment, and the --replicas flag is not supported by kubectl run, so no three-replica Deployment results. It suits quick one-off Pod creation for testing, not declarative multi-replica workloads.
- ✓
kubectl create deployment nginx --image=nginx --replicas=3
Why this is correct
The `--replicas=3` flag on `kubectl create deployment` directly satisfies the stem's three-replica constraint, while `--image=nginx` specifies the container image. This imperative command generates the Deployment manifest server-side, so no YAML file is needed to achieve the required nginx workload at the stated scale.
- ✗
kubectl scale deployment nginx --replicas=3
Why it's wrong here
kubectl scale alters the replica count of an existing Deployment; it cannot create one, so it fails when no Deployment named nginx exists yet. It is the right tool for resizing an already-running Deployment during load changes.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 930-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This KCNA 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 KCNA exam.