300-910 · Question #108
A developer must review all the configuration that has been applied to set up a UI-based service called "UI". The code exists in the "master" namespace. Which command must be used to review and valida
The correct answer is C. kubectl describe service UI -n master. To review the detailed configuration of a Kubernetes service named "UI" in the "master" namespace, the kubectl describe service UI -n master command should be used.
Question
Exhibit
Options
- Akubectl get services UI -n master
- Bkubectl describe service UI -all-namespaces
- Ckubectl describe service UI -n master
- Dkubectl describe UI -n master
How the community answered
(51 responses)- A4% (2)
- B10% (5)
- C71% (36)
- D16% (8)
Why each option
To review the detailed configuration of a Kubernetes service named "UI" in the "master" namespace, the `kubectl describe service UI -n master` command should be used.
`kubectl get services UI -n master` would only provide a summary of the service (like its name, cluster IP, external IP, ports), not the detailed configuration required for review and validation.
`kubectl describe service UI -all-namespaces` would attempt to describe a service named "UI" across all namespaces, which is inefficient and not specific to the "master" namespace where the service is known to exist.
The `kubectl describe` command provides a detailed view of a specific Kubernetes resource, including its configuration, status, and related events. By specifying `service UI` and the `-n master` flag, the command will output all relevant configuration and operational details for the "UI" service exclusively within the "master" namespace, which is exactly what the developer needs to review and validate its setup.
`kubectl describe UI -n master` is syntactically incorrect because `UI` alone is not a valid resource type; it needs to be prefixed with the resource type, such as `service` or `deployment`.
Concept tested: Kubernetes command-line tools - describe service
Source: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#describe
Topics
Community Discussion
No community discussion yet for this question.
