nerdexam
Cisco

300-910 · Question #110

An application is developed based on microservices. The application must be installed on a pod in a separate cluster. Which command must be used to deploy the application?

The correct answer is C. kubectl run kubernetes-deployment\ --image=gcr.io/kubertfetes-deployment:v1 \ --port=8080. To deploy an application as a pod or deployment directly from a container image in Kubernetes, the kubectl run command with the image and port specifications is used.

Deployment

Question

An application is developed based on microservices. The application must be installed on a pod in a separate cluster. Which command must be used to deploy the application?

Exhibit

300-910 question #110 exhibit

Options

  • Akubectl get nodes
  • Bkubectl run deployments
  • Ckubectl run kubernetes-deployment
    --image=gcr.io/kubertfetes-deployment:v1
    --port=8080
  • Dkubectl version

How the community answered

(28 responses)
  • A
    4% (1)
  • C
    93% (26)
  • D
    4% (1)

Why each option

To deploy an application as a pod or deployment directly from a container image in Kubernetes, the `kubectl run` command with the image and port specifications is used.

Akubectl get nodes

`kubectl get nodes` is used to list the nodes in the cluster and their status, not to deploy an application.

Bkubectl run deployments

`kubectl run deployments` is an incomplete and incorrect command; `deployments` is a resource type, but `kubectl run` requires an image and a name to create an instance.

Ckubectl run kubernetes-deployment\ --image=gcr.io/kubertfetes-deployment:v1 \ --port=8080Correct

The `kubectl run` command is used to create and run a specific container or deployment in a Kubernetes cluster. The provided command `kubectl run kubernetes-deployment --image=gcr.io/kubertfetes-deployment:v1 --port=8080` instructs Kubernetes to create a deployment named `kubernetes-deployment`, using the specified Docker image and exposing port 8080, which directly deploys the application as a pod (or set of pods via a Deployment object).

Dkubectl version

`kubectl version` displays the client and server versions of Kubernetes, which is for informational purposes, not for deploying applications.

Concept tested: Kubernetes deploying applications with kubectl run

Source: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#run

Topics

#Kubernetes deployment#kubectl commands#Microservices#Containerization

Community Discussion

No community discussion yet for this question.

Full 300-910 Practice