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.
Question
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)- A87% (53)
- B2% (1)
- C3% (2)
- D8% (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.
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.
`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.
`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.
`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
Community Discussion
No community discussion yet for this question.