Triage a CrashLoopBackOff pod in 60 seconds
Когда использовать: Alerts fire; you want to see logs, events, and resource usage before digging in kubectl manually.
Предварительные требования
- kubectl configured with cluster access — kubectl config get-contexts should list your cluster
Поток
-
Identify crashing podsList pods in namespace X with restart count > 5. Show pod name, container, and last exit reason.✓ Скопировано→ Narrowed list
-
Pull logs + eventsFor pod Y, get last 100 lines of logs and the related events. Highlight any error keywords.✓ Скопировано→ Likely root cause
-
Check resource pressureShow CPU/memory limits vs actual for the pod. OOM killed?✓ Скопировано→ Resource verdict
Итог: A focused hypothesis in a minute, not ten kubectl commands.
Подводные камни
- Wrong cluster context — Always specify --context in your prompt; the default can bite you across prod/staging