Поды с наибольшим числом рестартов k8s-debug
Ранжирует поды во всём кластере по числу рестартов, чтобы быстро находить crash-loop
kubectl get po -A --sort-by='.status.containerStatuses[0].restartCount' | tail -20
more k8s-debug
all 27 commands →
Поиск OOMKilled-контейнеров
kubectl get po -A -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.status.containerStatuses[*].lastState.terminated.reason}{"\n"}{end}' | grep OOMKilled
Причина зависания Pending-подов
kubectl get po -A --field-selector=status.phase=Pending -o name | xargs -I{} kubectl describe {} -n <ns> | grep -A3 FailedScheduling
Диагностика узла NotReady
kubectl describe node <node> | grep -A12 Conditions; ssh <node> 'journalctl -u kubelet -n 100 --no-pager'
Причина ImagePullBackOff
kubectl get events -n <ns> --field-selector reason=Failed -o wide | grep -i 'pull\|manifest\|unauthorized'
Очистка вытесненных подов
kubectl get po -A | grep Evicted | awk '{print $2" -n "$1}' | xargs -L1 kubectl delete po