kubectl get nodes 显示 NotReady,节点上的 Pod 会被打上污点,调度过去的新 Pod 全 Pending。
第一步:kubelet 状态
systemctl status kubelet journalctl -u kubelet -n 100 --no-pager
Failed to run kubelet 后面跟的原因最直接。
第二步:容器运行时
systemctl status containerd crictl ps
containerd 挂了,kubelet 报 container runtime is down。crictl 连不上要去 /etc/crictl.yaml 配 endpoint:unix:///run/containerd/containerd.sock。
第三步:常见具体报错
failed to get node ip:节点有多个网卡,加 --node-ip 指定。Unable to register node:apiserver 不通,检查 VIP、证书、防火墙 6443。PLEG is not healthy:运行时卡住,重启 containerd。
第四步:网络插件
kubectl -n kube-system get pod -o wide | grep -E "calico|flannel|coredns"
CNI 没就绪,节点会报 NetworkPluginNotReady,节点同样 NotReady。先解决 CNI。
磁盘和 inode
df -h /var/lib/kubelet df -i /var/lib/kubelet
磁盘满或者 inode 用尽,kubelet 直接罢工,这种最容易忽略。