Container Orchestration
medium
Questão de Container Orchestration #019e3a4f
Enunciado da Questão
Container Orchestration
#kubernetes
#kubectl
#deployment
#replicas
Médio
The cloud native architecture centered around microservices provides a strong system that ensures ______________.
A
fallback
B
resiliency
Correta
C
failover
D
high reachability
Explicação Oficial / Explicações da Comunidade
The correct command to create a Kubernetes Deployment with 2 replicas is kubectl create deploy nginx --image=nginx --replicas=2. This uses the kubectl create deployment subcommand (abbreviated as deploy) to create a Deployment named nginx with the specified container image and replica count.
How it Works
kubectl create deploymentis the standard command to create a Deployment resource in Kubernetes.- The
--imageflag specifies the container image to use for the pods. - The
--replicasflag sets the desired number of pod replicas. - The Deployment controller ensures that the specified number of pods are running and handles updates and rollbacks.
Why Other Options Are Incorrect
kubectl run deploy nginx --image=nginx --replicas=2: Thekubectl runcommand is used to create a single pod or a deployment, but its syntax for creating a deployment iskubectl run <name> --image=<image>. The--replicasflag is not valid forkubectl run; it only creates a single pod by default. Additionally, the worddeployin the command is misinterpreted as the pod name, not a subcommand.kubectl create nginx deployment --image=nginx –replicas=2: This command has incorrect argument order. The correct syntax iskubectl create deployment <name> --image=<image>. Placing the name aftercreateand beforedeploymentis invalid.kubectl create deploy nginx --image=nginx --count=2: The--countflag is not a valid flag forkubectl create deployment. The correct flag is--replicas. Using--countwill result in an error or be ignored.