1. Events & state
describe shows a resource's spec, status, and recent events — the first debugging stop.
kubectl describe pod web-0Typorithm · medium
Step 1 of 8 · intro card
kubectl Commands
Debug a pod with describe (events), logs -f (live output), logs --previous (after a crash), and exec -it (a shell inside).
When a pod misbehaves, describe is the first stop: it surfaces events like image pull or scheduling failures.
logs streams container output; -f follows it live and --previous recovers the crashed instance's logs.
exec -it drops you into a shell inside the container to inspect files, env, and connectivity.
describe shows events first.
logs -f follows; --previous after a crash.
exec -it -- sh opens a shell.
kubectl describe pod web-0
kubectl logs web-0 -f
kubectl logs web-0 --previous
kubectl exec -it web-0 -- shConnect each part of the code to the concept before you type.
describe shows a resource's spec, status, and recent events — the first debugging stop.
kubectl describe pod web-0-f streams the container's stdout/stderr live.
kubectl logs web-0 -f--previous shows logs from the prior, crashed container instance.
kubectl logs web-0 --previousexec -it opens an interactive shell in the running container.
kubectl exec -it web-0 -- shRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.