If you want to quickly list all available API resources in your current Kubernetes cluster from the command line, which command would you use?

Study for the Kubernetes Cloud Native Associate (KCNA) Certification. Prepare with flashcards and multiple choice questions. Ensure success with detailed explanations. Ready for your exam!

Multiple Choice

If you want to quickly list all available API resources in your current Kubernetes cluster from the command line, which command would you use?

Explanation:
You’re looking to discover what kinds of resources the Kubernetes API server can manage from the command line. The command that lists all available API resources is kubectl api-resources. It queries the API server and returns a table showing each resource kind (like pods, deployments, services), its short names, the API group it belongs to, and whether it is namespaced. This gives you a quick, comprehensive view of what you can create, edit, or delete in the cluster without targeting a specific instance. Other commands either operate on specific resources you already know about or don’t exist to list resources in bulk. For example, a get-like command would require you to specify a particular resource type, describe targets a single resource or type, and a list-resources command isn’t a standard kubectl command. The api-resources command is the right tool for surveying the available API surface in the cluster.

You’re looking to discover what kinds of resources the Kubernetes API server can manage from the command line. The command that lists all available API resources is kubectl api-resources. It queries the API server and returns a table showing each resource kind (like pods, deployments, services), its short names, the API group it belongs to, and whether it is namespaced. This gives you a quick, comprehensive view of what you can create, edit, or delete in the cluster without targeting a specific instance.

Other commands either operate on specific resources you already know about or don’t exist to list resources in bulk. For example, a get-like command would require you to specify a particular resource type, describe targets a single resource or type, and a list-resources command isn’t a standard kubectl command. The api-resources command is the right tool for surveying the available API surface in the cluster.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy