Kubernetes and Cloud Native Associate (KCNA) — Question 171
Which command will list the resource types that exist within a cluster?
Answer options
- A. kubectl api-resources
- B. kubectl get namespaces
- C. kubectl api-versions
- D. curl https://kubectrl/namespaces
Correct answer: A
Explanation
The command 'kubectl api-resources' provides a list of the resource types available in the Kubernetes cluster, making it the correct choice. The option 'kubectl get namespaces' retrieves information about namespaces, while 'kubectl api-versions' lists the API versions supported, and 'curl https://kubectrl/namespaces' is a malformed command that does not serve the intended purpose.