Which kubectl command lists all API resources available in a Kubernetes cluster?

Study for the Kubernetes Certified Network Administrator Exam. Our test offers comprehensive flashcards, multiple-choice questions, and detailed explanations. Be confident for your exam!

Multiple Choice

Which kubectl command lists all API resources available in a Kubernetes cluster?

Explanation:
To discover every resource kind the cluster knows about, you use a command that asks the API server for the complete set of API resources. The kubectl api-resources command does exactly that: it lists all API resources available in the cluster, including their API group, whether they’re namespaced, their short names, and the verbs supported for each. This is the best way to see what you can create or manage in the cluster, from common items like pods and deployments to cluster-scoped resources and CRDs. Other options don’t serve this purpose. kubectl get all shows a subset of common resources in the current namespace, not the full catalog of API resources. kubectl describe resources and kubectl list apis aren’t valid kubectl commands, so they won’t produce the information you need.

To discover every resource kind the cluster knows about, you use a command that asks the API server for the complete set of API resources. The kubectl api-resources command does exactly that: it lists all API resources available in the cluster, including their API group, whether they’re namespaced, their short names, and the verbs supported for each. This is the best way to see what you can create or manage in the cluster, from common items like pods and deployments to cluster-scoped resources and CRDs.

Other options don’t serve this purpose. kubectl get all shows a subset of common resources in the current namespace, not the full catalog of API resources. kubectl describe resources and kubectl list apis aren’t valid kubectl commands, so they won’t produce the information you need.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy