nerdexam
Linux_Foundation

KCNA · Question #85

Which of the following is the correct command to run a nginx deployment with 2 replicas? kubectl run deploy nginx --image=nginx --replicas=2 A.

The correct answer is B. kubectl create deploy nginx --image=nginx --replicas=2. The correct command to create a new Kubernetes Deployment with a specified image and number of replicas is kubectl create deployment.

Submitted by fatima_kr· May 4, 2026Container Orchestration

Question

Which of the following is the correct command to run a nginx deployment with 2 replicas? kubectl run deploy nginx --image=nginx --replicas=2 A.

Options

  • Bkubectl create deploy nginx --image=nginx --replicas=2
  • Ckubectl create nginx deployment --image=nginx -replicas=2

How the community answered

(35 responses)
  • B
    91% (32)
  • C
    9% (3)

Why each option

The correct command to create a new Kubernetes Deployment with a specified image and number of replicas is `kubectl create deployment`.

Bkubectl create deploy nginx --image=nginx --replicas=2Correct

The `kubectl create deployment` command is specifically designed to create a Deployment resource, allowing parameters like `--image` to specify the container image and `--replicas` to define the desired number of pod instances. This creates a declarative object that Kubernetes will manage.

Ckubectl create nginx deployment --image=nginx -replicas=2

The syntax `kubectl create nginx deployment` is incorrect; the resource type `deployment` should follow `create`, and `-replicas` is not the standard flag (it should be `--replicas`).

Concept tested: Kubernetes Deployment creation via kubectl

Source: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#creating-resources

Topics

#kubectl#Deployment#Replicas#CLI

Community Discussion

No community discussion yet for this question.

Full KCNA Practice