Kubernetes Administration
medium

Questão de Kubernetes Administration #019e3a4f

Enunciado da Questão
Kubernetes Administration
#kubectl
#api-resources
#kubernetes
#cluster
Médio

Which command will list the resource types that exist within a cluster?

A

kubectl api-resources

Correta
B

kubectl get namespaces

C

kubectl api-versions

Explicação Oficial / Explicações da Comunidade

The command kubectl api-resources lists all resource types available in the cluster, including built-in and custom resources. It displays the resource name, short names, API version, and whether it is namespaced.

How it Works

kubectl api-resources queries the Kubernetes API server for the OpenAPI schema and aggregates all resource types defined in the cluster. It is useful for discovering available resources and their API groups.

Why the Correct Answer is Right

kubectl api-resources directly fulfills the requirement to list resource types. It is the standard command for this purpose.

Why the Incorrect Answers are Wrong

  • kubectl get namespaces lists only namespaces, not all resource types.
  • kubectl api-versions lists supported API versions (e.g., v1, apps/v1), not resource types.
  • curl https://kubectrl/namespaces is not a valid command; it attempts to access a non-existent endpoint and does not list resource types.