Kubernetes Administration
medium
Pregunta de Kubernetes Administration #019e3a4f
Enunciado de la Pregunta
Kubernetes Administration
#kubectl
#describe
#kubernetes
#resource-inspection
Medio
Which kubectl command is useful for collecting information about any type of resource that is active in a Kubernetes cluster?
A
describe
Correcto
B
list
C
expose
D
explain
Explicación Oficial / Explicaciones de la Comunidad
The kubectl describe command is the correct tool for collecting detailed information about any type of resource active in a Kubernetes cluster. It provides a comprehensive view of the resource's current state, including events, configuration, and status fields.
How it Works
kubectl describe retrieves and displays the full specification and current status of a Kubernetes resource (e.g., pods, services, nodes, deployments). It shows metadata, spec, status, and recent events related to the resource. This makes it invaluable for debugging and understanding the live state of cluster objects.
Why the Correct Value is Right
kubectl describeis designed specifically to give verbose, human-readable details about any resource type. It works with all built-in and custom resources, making it the universal command for gathering information.
Why the Incorrect Values are Wrong
kubectl listis not a valid kubectl command. The correct command for listing resources iskubectl get, which provides a concise summary (e.g., names and statuses) but not the detailed information thatdescribeoffers.kubectl exposeis used to create a Kubernetes Service from an existing resource (like a deployment or pod) to expose it as a network service. It does not collect information about resources.kubectl explainis used to retrieve documentation about resource fields and their usage. It shows the schema and description of a resource type (e.g.,kubectl explain pod.spec.containers), but it does not fetch information about active resources in the cluster.