在 CentOS 上运行的 Kubernetes(k8s)节点掉线(Node NotReady / 节点失联),常见原因可以分为 网络、资源、组件、系统层面 几类。下面按最常见 → 较少见给你系统梳理。
现象
NotReadykubectl get node 中 STATUS 异常排查
systemctl status kubelet
journalctl -u kubelet -f
常见原因
现象
检查
free -h
top
df -h
重点看
/var/lib/(kubelet 数据目录)满CentOS 默认:
检查
getenforce
systemctl status firewalld
建议
setenforce 0
systemctl stop firewalld
(生产环境需按需开放端口)
检查
ping master-ip
telnet master-ip 6443
常见原因
现象
检查
systemctl status docker
# 或
systemctl status containerd
常见问题
现象
检查
openssl x509 -in /var/lib/kubelet/pki/kubelet-client-current.pem -noout -dates
解决
kubeadm certs renew现象
检查
kubectl get pods -n kube-system
常见错误:
net.bridge.bridge-nf-call-iptables=0修复
modprobe br_netfilter
sysctl -w net.bridge.bridge-nf-call-iptables=1
# 1. 看节点状态
kubectl get node
# 2. 看 kubelet
systemctl status kubelet
journalctl -u kubelet -n 100
# 3. 看资源
free -h
df -h
top
# 4. 看网络
ping <master>
telnet <master> 6443
# 5. 看容器运行时
systemctl status docker
kubectl describe node)我可以直接帮你看具体原因和修复方案。