有一个不错的排查流程,在这里。
https://learnk8s.io/troubleshooting-deployments
还有PDF版本。
https://learnk8s.io/a/troubleshooting-kubernetes.pdf
这里将每一个步骤截子图来分析,完整排查图可以跳到末尾来看。
首先,考虑是否PENDING
主要的命令是
kubectl get pods
kubectl describe pod <pod-name> : cluster full, ResourceQuota, PENDDING PersisitentVolumeClaim
kubectl get pods -o wide : assign to node, Scheduler issue, Kubelet issue
接下来看Pods未RUNNING的问题
kubectl logs <pod-name> : application issue
kubectl logs <pod-name> --previous : pod died too quickly
kubectl describe pod <pod-name> :
ImagePullBackOff, image name incorrect, image tag invalid, private registry, CRI or kubelet issue
CrashLoopBackOff, app crashing, Dockerfile CMD instruction, liveness p