k8s join集群时报错Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker:
join集群时节点一直是不可用状态:
在节点上查看日志:
journalctl -f -u kubelet.service
报错如下:
3月 10 16:25:56 server6 kubelet[9720]: E0310 16:25:56.458944 9720 kubelet.go:2184] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
3月 10 16:26:00 server6 kubelet[9720]: W0310 16:26:00.769218 9720 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d
解决方法,将master上/etc/cni/net.d 目录下的文件拷贝到有问题的节点上:
scp server4:/etc/cni/net.d/* /etc/cni/net.d/
可以了: