Courseiva
Container OrchestrationmediumMultiple ChoiceObjective-mapped

KCNA Container Orchestration Practice Question

Which command correctly creates a Deployment named 'web-app' with the image 'nginx:1.21' and 3 replicas?

⚠ Common exam trap

CNCF often tests the distinction between `kubectl run` (which creates a Pod, not a Deployment) and `kubectl create deployment` (which creates a Deployment with replica management), leading candidates to mistakenly choose `kubectl run` when replicas are required.

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 web-app --image=nginx:1.21 --replicas=3

`kubectl create deployment` is the imperative command specifically designed to create a Deployment resource in Kubernetes. The `--image` flag specifies the container image, and `--replicas=3` sets the desired number of pod replicas, which matches the requirement exactly.

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 apply deployment web-app --image=nginx:1.21 --replicas=3

    Why it's wrong here

    'kubectl apply' is used to apply a manifest file; its syntax does not accept --image and --replicas directly.

  • kubectl run web-app --image=nginx:1.21 --replicas=3

    Why it's wrong here

    'kubectl run' creates a Pod, not a Deployment; it does not support the --replicas flag.

  • kubectl create deployment web-app --image=nginx:1.21 --replicas=3

    Why this is correct

    This is the correct syntax to create a Deployment with the given name, image, and replica count.

  • kubectl create deployement web-app --image=nginx:1.21 --replicas=3

    Why it's wrong here

    The correct command is 'deployment', not 'deployement'.

About these practice questions

One of 833 original KCNA 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

Same concept, more angles

1 more way this is tested on KCNA

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which command is used to create a Deployment that runs an nginx container with 3 replicas?

easy
  • A.kubectl create pod nginx --image=nginx --replicas=3
  • B.kubectl run nginx --image=nginx --replicas=3
  • C.kubectl create deployment nginx --image=nginx --replicas=3
  • D.kubectl scale deployment nginx --replicas=3

Why C: `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.

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.