http://www.voidcn.com/article/p-wpuagtbj-byy.html
? 考虑到node节点的kubelet报错Unable to update cni config: No networks found in /etc/cni/net.d,并且master节点的/etc/cni/net.d目录里拥有10-flannel.conflist文件,
? 我们可以把该文件从master节点复制到node节点的对应目录中,然后重启kubelet服务即可。
? (该方法亡羊补牢,对我的问题也没用)
我这边使用这个方法解决的 感觉挺有效果 留下来.
一开始的状态:
[root@k8s106 ~]# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s106 Ready master 59d v1.14.1
k8snode01 NotReady <none> 2d22h v1.14.1
当时报错信息为:
[root@k8snode01 flannel]# systemctl status kubelet
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: active (running) since Fri 2020-01-17 09:25:06 CST; 7min ago
Docs: https://kubernetes.io/docs/
Main PID: 5694 (kubelet)
CGroup: /system.slice/kubelet.service
└─5694 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=systemd --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.1
Jan 17 09:32:11 k8snode01 kubelet[5694]: W0117 09:32:11.141609 5694 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 17 09:32:11 k8snode01 kubelet[5694]: E0117 09:32:11.666478 5694 kubelet.go:2170] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 17 09:32:16 k8snode01 kubelet[5694]: W0117 09:32:16.142092 5694 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 17 09:32:16 k8snode01 kubelet[5694]: E0117 09:32:16.668065 5694 kubelet.go:2170] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 17 09:32:21 k8snode01 kubelet[5694]: W0117 09:32:21.142460 5694 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 17 09:32:21 k8snode01 kubelet[5694]: E0117 09:32:21.669779 5694 kubelet.go:2170] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 17 09:32:26 k8snode01 kubelet[5694]: W0117 09:32:26.142913 5694 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 17 09:32:26 k8snode01 kubelet[5694]: E0117 09:32:26.671288 5694 kubelet.go:2170] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 17 09:32:31 k8snode01 kubelet[5694]: W0117 09:32:31.143443 5694 cni.go:213] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 17 09:32:31 k8snode01 kubelet[5694]: E0117 09:32:31.673118 5694 kubelet.go:2170] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized