Skip to content
Latchkey

kubectl describe: Debug Resources in CI

Print a detailed, human-readable view of a resource, including its recent events.

kubectl describe shows a resource plus the events the scheduler and kubelet emitted about it, which is the fastest way to find out why a pod is Pending or crashing. In CI it is run on failure to dump diagnostic context into the job log.

Common flags

  • TYPE NAME - e.g. pod my-pod (positional)
  • -n NAMESPACE - target namespace
  • -l key=value - describe all resources matching a selector

Example in CI

Dump events for failing api pods when a deploy fails.

shell
kubectl describe pod -l app=api -n prod

Common errors in CI

  • Error from server (NotFound): pods "X" not found - wrong name or namespace
  • the server doesn't have a resource type "X" - misspelled resource kind
  • Events show FailedScheduling / Insufficient cpu - no node can satisfy the pod requests

Key takeaways

  • Shows resource detail plus events; the fastest path to a root cause.
  • Run it on failure to capture why pods are Pending or crashing.
  • The Events section is where scheduling and image-pull failures surface.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →