VMware Carbon Black Cloud Enterprise EDR (2020) — Question 97
Which kubectl command is used to deploy the application when using a Kubernetes deployment specification file, my-app.yaml?
Answer options
- A. kubectl run my-app.yaml
- B. kubectl apply -f my-app.yaml
- C. kubectl create my-app.yaml
- D. kubectl apply spеc my-app.yaml
Correct answer: B
Explanation
The correct command is 'kubectl apply -f my-app.yaml' because it applies the configuration in the specified file to create or update the resources defined in it. The other commands do not correctly deploy the application: 'kubectl run' creates a pod directly, 'kubectl create' is not used with a file in this context, and 'kubectl apply spеc' is an incorrect command as 'spеc' is not a valid option.