Sign In

Curriculum 3: Your First Kubectl Commands

The kubectl describe Command

12 min · 15 XP

kubectl describe -- Detailed Resource Inspection

While kubectl get gives you a summary, kubectl describe gives you the full story. It shows detailed information about a resource including its configuration, current state, conditions, events, and related resources.

Basic Usage

The syntax follows the same pattern as other kubectl commands:

kubectl describe <resource-type> <resource-name>

For example:

# Describe a specific pod
kubectl describe pod my-app-7d4b8c6f5-x2k9p

# Describe a deployment
kubectl describe deployment my-app

# Describe a node
kubectl describe node worker-1

# Describe a service
kubectl describe service my-service

What You See in the Output

The describe output is organized into sections. For a Pod, you will typically see:

  • Name, Namespace, and Labels -- basic identification
  • Node -- which node the Pod is running on
  • Status -- whether the Pod is Running, Pending, or Failed
  • IP -- the Pod's internal IP address
  • Containers -- image, ports, environment variables, resource limits, and volume mounts for each container
  • Conditions -- a table showing PodScheduled, Initialized, ContainersReady, and Ready states
  • Volumes -- details about attached storage
  • Events -- a timeline of what happened to the Pod

Reading the Events Section

The events section at the bottom is the most valuable part for troubleshooting. Events tell you exactly what Kubernetes did and whether anything went wrong:

Events:
  Type     Reason     Age   From               Message
  ----     ------     ---   ----               -------
  Normal   Scheduled  2m    default-scheduler  Successfully assigned default/my-app to worker-1
  Normal   Pulled     2m    kubelet            Container image "nginx:1.25" already present
  Normal   Created    2m    kubelet            Created container nginx
  Normal   Started    2m    kubelet            Started container nginx

Warning events indicate problems:

Events:
  Type     Reason     Age   From     Message
  ----     ------     ---   ----     -------
  Warning  Failed     30s   kubelet  Error: ImagePullBackOff
  Warning  BackOff    15s   kubelet  Back-off pulling image "nginx:wrong-tag"

Describe Without a Name

If you omit the resource name, kubectl describes all resources of that type:

# Describe all pods in the current namespace
kubectl describe pods

This can produce a lot of output, so it is usually better to target a specific resource.

Key Takeaways

  • kubectl describe provides comprehensive details about any resource
  • The Events section is your primary tool for understanding why something failed
  • Conditions show the current state of health checks and readiness
  • Use describe on Pods, Nodes, Deployments, and Services during troubleshooting
  • You can describe resources across namespaces with -n <namespace>