failed to find plugin “flannel” in path [/opt/cni/bin],k8sNotReady解决方案
Posted 呆萌很
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了failed to find plugin “flannel” in path [/opt/cni/bin],k8sNotReady解决方案相关的知识,希望对你有一定的参考价值。
问题
由于k8s安装master一直处于NotReady状态查看日志出现 failed to find plugin “flannel” in path [/opt/cni/bin]
日志信息
Nov 04 00:35:47 k8s-node1 kubelet[2814]: : [failed to find plugin "flannel" in path [/opt/cni/bin]]
Nov 04 00:35:47 k8s-node1 kubelet[2814]: W1104 00:35:47.520553 2814 cni.go:239] Unable to update cni config: no valid networks found in /etc/cni/net.d
Nov 04 00:35:48 k8s-node1 kubelet[2814]: E1104 00:35:48.764306 2814 kubelet.go:2103] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Nov 04 00:35:52 k8s-node1 kubelet[2814]: W1104 00:35:52.524329 2814 cni.go:204] Error validating CNI config list
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "name": "cbr0",
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "cniVersion": "0.3.1",
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "plugins": [
Nov 04 00:35:52 k8s-node1 kubelet[2814]:
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "type": "flannel",
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "delegate":
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "hairpinMode": true,
Nov 04 00:35:52 k8s-node1 kubelet[2814]: "isDefaultGateway": true
Nov 04 00:35:52 k8s-node1 kubelet[2814]:
Nov 04 00:35:52 k8s-node1 kubelet[2814]: ,
查看 /opt/cni/bin 缺少 flannel
查看节点状态
kubectl get nodes
查看日志命令
journalctl -u kubelet -f
解决方案
需要下载CNI插件:CNI plugins v0.8.6
github下载地址:https://github.com/containernetworking/plugins/releases/tag/v0.8.6
(在1.0.0版本后CNI Plugins中没有flannel)
下载后通过xftp 上传到Linux /home目录解压
tar zxvf cni-plugins-linux-amd64-v0.8.6.tgz
复制 flannel 到 /opt/cni/bin/
[root@k8s-node1 home]# cp flannel /opt/cni/bin/
查看节点状态
查看到状态立马变为Ready,至此解决问题。
以上是关于failed to find plugin “flannel” in path [/opt/cni/bin],k8sNotReady解决方案的主要内容,如果未能解决你的问题,请参考以下文章
解决This application failed to start because it could not find or load the Qt platform plugin “windows
repackage failed: Unable to find main class
win7 上eclipse无法运行..但运行就弹出failed to find a Main Class in"D:\eclipse\\plugins/org
Maven异常_02_compile faile_Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:c