nerdexam
Cisco

300-910 · Question #109

A developer must maintain identical copies of pods deployed or run at any given time. To maintain these copies, a ReplicaSet Kubernetes controller is used. The controller is defined in a file named "d

The correct answer is A. kubectl create -f devnet.yaml. To deploy a Kubernetes ReplicaSet defined in a YAML file, the kubectl create -f command is used to instantiate the resource in the cluster.

Application Deployment and Operations

Question

A developer must maintain identical copies of pods deployed or run at any given time. To maintain these copies, a ReplicaSet Kubernetes controller is used. The controller is defined in a file named "devnet.yaml". Which command deploys the ReplicaSet to the cluster?

Options

  • Akubectl create -f devnet.yaml
  • Bkubectl run -f devnet.yaml
  • Ckubectl rollout -f devnet.yaml
  • Dkubectl set -f devnet.yaml

How the community answered

(61 responses)
  • A
    87% (53)
  • B
    2% (1)
  • C
    3% (2)
  • D
    8% (5)

Why each option

To deploy a Kubernetes ReplicaSet defined in a YAML file, the `kubectl create -f` command is used to instantiate the resource in the cluster.

Akubectl create -f devnet.yamlCorrect

The `kubectl create -f <filename>` command is the standard and most direct way to create Kubernetes resources (like ReplicaSets, Deployments, Services, etc.) from a manifest file. It parses the YAML or JSON definition in `devnet.yaml` and submits it to the Kubernetes API server, which then creates the specified ReplicaSet in the cluster.

Bkubectl run -f devnet.yaml

`kubectl run` is typically used to create and run a single pod or a deployment directly from an image, not to create resources defined in a YAML file.

Ckubectl rollout -f devnet.yaml

`kubectl rollout` is used for managing the rollout of deployments, such as updating, pausing, or undoing a deployment, not for the initial creation of a ReplicaSet from a file.

Dkubectl set -f devnet.yaml

`kubectl set` is used to update specific fields of Kubernetes objects, like images, environment variables, or resource limits, not for initial creation of a resource from a manifest file.

Concept tested: Kubernetes deploying resources from YAML

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

Topics

#Kubernetes#ReplicaSet#kubectl#Resource Deployment

Community Discussion

No community discussion yet for this question.

Full 300-910 Practice