kubectl 1.37 reference · Basics
kubectl describe Command (kubectl)
Show a detailed, human-readable view of a resource, including related events, the first place to look when debugging.
kubectl 1.37
Syntax
kubectl describe RESOURCE NAME [-n NAMESPACE]
Parameters
| Parameter | Description |
|---|---|
RESOURCE NAME |
What to describe, e.g. pod web-7d9f8 or node worker-1. |
--show-events=false |
Hide the events section. |
Examples
kubectl create namespace rc-ref-desc > /dev/null
trap 'kubectl delete namespace rc-ref-desc --wait=false > /dev/null' EXIT
kubectl -n rc-ref-desc run app --image=busybox:1.37 --labels=tier=demo -- sleep 3600 > /dev/null
kubectl -n rc-ref-desc wait --for=condition=Ready pod/app --timeout=120s > /dev/null
kubectl -n rc-ref-desc describe pod app | grep -E '^(Name|Namespace|Labels|Status):' | tr -s ' '
Output
Name: app Namespace: rc-ref-desc Labels: tier=demo Status: Running
Run this on your computer — see “Get Started” for setup.
kubectl create namespace rc-ref-desc2 > /dev/null
trap 'kubectl delete namespace rc-ref-desc2 --wait=false > /dev/null' EXIT
kubectl -n rc-ref-desc2 run broken --image=busybox:does-not-exist > /dev/null
kubectl -n rc-ref-desc2 wait --for=jsonpath='{.status.containerStatuses[0].state.waiting.reason}'=ImagePullBackOff pod/broken --timeout=120s > /dev/null
kubectl -n rc-ref-desc2 describe pod broken | grep -oE 'Failed to pull image "[^"]+"' | head -1
Output
Failed to pull image "busybox:does-not-exist"
Run this on your computer — see “Get Started” for setup.
Related
kubectl get· List resources in a table, or print them as YAML, JSON, JSONPath or custom columns for scripts and debugging.kubectl events· List recent cluster events (scheduling, image pulls, probe failures, kills) for a namespace or one resource, sorted by time.- Troubleshooting Pods · tutorial