k8s新增node节点一直notready状态的解决方法
- 2022-03-09 19:05:21
- 运维
- 33
- shevechco
今天在原有的k8s集群上新增一个节点,在使用kubeadm join命令增加node节点成功以后,等了5分钟,在master上查看新加节点状态一直是notready状态,然后进行排查
在node节点上执行命令查看kubelet日志
journalctl -f -u kubelet
日志如下:
Mar 09 13:52:46 k8s-cpu-node2 kubelet[12975]: E0309 13:52:46.191060 12975 kubelet.go:2347] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized" Mar 09 13:52:48 k8s-cpu-node2 kubelet[12975]: I0309 13:52:48.004966 12975 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d" Mar 09 13:52:51 k8s-cpu-node2 kubelet[12975]: E0309 13:52:51.210913 12975 kubelet.go:2347] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized" Mar 09 13:52:53 k8s-cpu-node2 kubelet[12975]: I0309 13:52:53.006202 12975 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d" Mar 09 13:52:56 k8s-cpu-node2 kubelet[12975]: E0309 13:52:56.229009 12975 kubelet.go:2347] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized" Mar 09 13:52:58 k8s-cpu-node2 kubelet[12975]: I0309 13:52:58.007075 12975 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"
看起来是网络cni插件有点问题,不能找到/etc/cni/net.d目录,然后去其它节点查看却有这个目录,然后试着将master节点的这个目录复制过来试试
scp -r k8s-cpu-master:/etc/cni /etc/cni
接着重启kubelet
systemctl restart kubelet
然后再等待3分钟左右,node节点就正常的ready状态了
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.sulao.cn/post/813
相关推荐
- k8s集群中mongdb、etcd、prometheus数据bash一键备份脚本
- k8s业务pod端口检测和日志采集bash脚本
- python获取k8s中使用物理卡pod列表脚本
- k8s基于clusterrole生成集群级别只读用户bash脚本
- k8s存储pv/pvc中的subPath的使用详解
- k8s容器退出码详细信息介绍
- k8s调度GPU节点并挂载GPU设备
- k8s使用nfs报错selfLink was empty, can't make reference
- centos7使用haproxy部署k8s高可用集群
- centos7部署k8s多master高可用集群(k8s+containerd+nginx+keepalived)