K8S集群 NOT READY的解决办法 1.13 错误信息:cni config uninitialized

Kubernetes 专栏收录该内容
33 篇文章 2 订阅
错误现象:

untime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

log:
#systemctl status kubelet
\u25cf kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kubelet.service.d
           \u2514\u250010-kubeadm.conf
   Active: active (running) since Tue 2020-01-07 15:08:20 UTC; 35min ago
     Docs: http://kubernetes.io/docs/
 Main PID: 910 (kubelet)
    Tasks: 23
   Memory: 93.5M
      CPU: 48.586s
   CGroup: /system.slice/kubelet.service
           \u2514\u2500910 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubele

Jan 07 15:43:41 nav1 kubelet[910]: E0107 15:43:41.868737     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 07 15:43:46 nav1 kubelet[910]: W0107 15:43:46.869683     910 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 07 15:43:46 nav1 kubelet[910]: E0107 15:43:46.869801     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 07 15:43:51 nav1 kubelet[910]: W0107 15:43:51.870672     910 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 07 15:43:51 nav1 kubelet[910]: E0107 15:43:51.870790     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 07 15:43:56 nav1 kubelet[910]: W0107 15:43:56.871658     910 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 07 15:43:56 nav1 kubelet[910]: E0107 15:43:56.871779     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 07 15:44:01 nav1 kubelet[910]: W0107 15:44:01.872529     910 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 07 15:44:01 nav1 kubelet[910]: E0107 15:44:01.872649     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 07 15:44:06 nav1 kubelet[910]: W0107 15:44:06.873414     910 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 07 15:44:06 nav1 kubelet[910]: E0107 15:44:06.873540     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Jan 07 15:44:11 nav1 kubelet[910]: W0107 15:44:11.874201     910 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
Jan 07 15:44:11 nav1 kubelet[910]: E0107 15:44:11.874291     910 kubelet.go:2130] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
解决办法:
docker pull quay.io/coreos/flannel:v0.9.1-amd64

mkdir -p /etc/cni/net.d/

cat <<EOF> /etc/cni/net.d/10-flannel.conf
{"name":"cbr0","type":"flannel","delegate": {"isDefaultGateway": true}}
EOF
mkdir /usr/share/oci-umount/oci-umount.d -p
mkdir /run/flannel/
cat <<EOF> /run/flannel/subnet.env
FLANNEL_NETWORK=172.100.0.0/16
FLANNEL_SUBNET=172.100.1.0/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
EOF

然后执行命令:
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml
  • 1
    点赞
  • 2
    评论
  • 7
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值