300-910 · Question #36
A user wants to deploy a new service to a Kubernetes cluster. Which two commands accomplish this goal? (Choose two.)
The correct answer is A. Apply E. Expose. The question asks for two Kubernetes commands used to deploy a new service.
Question
Options
- AApply
- BInstall
- CDeploy
- DCreate
- EExpose
How the community answered
(64 responses)- A95% (61)
- B2% (1)
- C3% (2)
Why each option
The question asks for two Kubernetes commands used to deploy a new service.
The `kubectl apply` command is used to apply a configuration (e.g., a Deployment or Service definition) to a resource by filename or stdin, creating or updating resources if they already exist, which is a standard way to deploy services.
`kubectl install` is not a standard Kubernetes command for deploying services.
`kubectl deploy` is not a standard Kubernetes command for deploying services; deployment is typically managed via `kubectl apply` with a Deployment object.
While `kubectl create` can create individual resources, `kubectl apply` is generally preferred for declarative management in CI/CD, and `kubectl expose` is specifically for creating a Service object to expose other resources.
The `kubectl expose` command is specifically used to create a Service object to expose a Deployment, ReplicaSet, ReplicationController, or Pod, making it accessible within or outside the cluster. This is how you typically make a deployed application a "service."
Concept tested: Kubernetes service deployment commands
Source: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Topics
Community Discussion
No community discussion yet for this question.