Kubernetes Administration
medium

Questão de Kubernetes Administration #019e3a4f

Enunciado da Questão
Kubernetes Administration
#kubectl
#describe
#kubernetes
#resource-inspection
Médio

Which kubectl command is useful for collecting information about any type of resource that is active in a Kubernetes cluster?

A

describe

Correta
B

list

C

expose

D

explain

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

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 describe is 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 list is not a valid kubectl command. The correct command for listing resources is kubectl get, which provides a concise summary (e.g., names and statuses) but not the detailed information that describe offers.
  • kubectl expose is 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 explain is 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.