Troubleshooting Workloads

Advanced

Overview

Start with kubectl get pods to see status. CrashLoopBackOff means the container keeps exiting; Pending usually means it cannot be scheduled (resources or node selectors).

kubectl describe pod shows the Events section — the single most useful place to learn why something failed. kubectl logs (add --previous for a crashed container) shows application errors.

For deeper inspection, exec into a running pod, or use kubectl get events --sort-by=.lastTimestamp to see what is happening cluster-wide.

Cheatsheet

kubectl get podsCheck status (CrashLoopBackOff, Pending)
kubectl describe pod <name>Read the Events section
kubectl logs <pod> --previousLogs from the last crashed container
kubectl get events --sort-by=.lastTimestampRecent cluster events
kubectl top podLive CPU/memory per pod

Try it

A safe, simulated terminal. Run the suggested commands to see typical output.

simulated terminal

Type a command and press Enter, or click a suggestion below to run it.

$

Quick quiz

1. What does CrashLoopBackOff indicate?

2. Which section of `kubectl describe pod` is most useful for diagnosing failures?