inspection

kubectl describe

Shows a human-readable, aggregated view of a resource including its spec, status, related events, and controllers. It is the go-to command for debugging why a pod is Pending, CrashLoopBackOff, or otherwise misbehaving.

kubectl describe TYPE[/NAME | NAME] [flags]

Common flags

Flag Purpose
-n, --namespace Namespace of the resource.
-l, --selector Describe all resources matching a label selector.
-A, --all-namespaces Describe matching resources across all namespaces.
--show-events Include events section (default true; use =false to hide).
-f, --filename Describe the resources referenced in a file, directory, or URL.

Examples

kubectl describe pod web-abc123

See containers, volumes, conditions, and recent events for a pod.

kubectl describe node worker-1

Inspect node capacity, allocatable, taints, and running pods.

kubectl describe deploy api -n prod

Roll-history summary and ReplicaSet status for the api Deployment.

Gotcha

Output is not machine-parseable; use kubectl get -o yaml/json for scripting. Events roll off after ~1 hour by default.

Related commands

← All kubectl commands · Docker vs Kubernetes