Скопировать файл из пода k8s-debug
Скачать файл из работающего контейнера
kubectl cp mynamespace/mypod:/var/log/app.log ./app.log
more k8s-debug
all 27 commands →
Поды с наибольшим числом рестартов
kubectl get po -A --sort-by='.status.containerStatuses[0].restartCount' | tail -20
Поиск 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'