DEVOPS Exam QuestionsBrowse all questions from this exam

DEVOPS Exam - Question 41


A user wants to deploy a new service to a Kubernetes cluster. Which two commands accomplish this goal? (Choose two.)

Show Answer
Correct Answer: AD

To deploy a new service to a Kubernetes cluster, the commands 'kubectl apply' and 'kubectl create' are used. 'kubectl apply' is used to apply a specified configuration to a resource by file name or stdin, while 'kubectl create' is used to create a resource from a file or from stdin. 'kubectl expose' is used to create a new service exposure but does not deploy the service itself.

Discussion

2 comments
Sign in to comment
SSSSSS
Aug 29, 2024

A and D The kubectl command has "apply" and "create" only, I think...

SSSSSS
Aug 29, 2024

Oops, it has "expose" as well If the pods or deployments are already there and he wants to deploy a new service, A and E should be correct.

CaveatOptions: AD
Feb 8, 2025

Expose is for exposing a port to the internet by way of a public ip. Apply and create make new things with the big difference being that create will fail if the resource already exists and apply will update the resource based on the Yaml.