kubernetes 1.16.0 flannel 无法正常启动 报错 Solves "Error validating CNI config &{cbr0 false…"

问题描述

centos7+ 下搭建 kubernetes 1.16.0 集群 使用 ipvs, flannel 无法正常启动 报错 Solves “Error validating CNI config &{cbr0 false…”

官网issue 地址: https://github.com/coreos/flannel/pull/1179

Sep 19 06:33:49 master-1 kubelet[2168]: W0919 06:33:49.140365    2168 cni.go:202] Error validating CNI config &{cbr0  false [0xc000331b00 0xc000331c20] [123 10 32 32 34 110 97 109 101 34 58 32 34 99 98 114 48 34 44 10 32 32 34 112 108 117 103 105 110 115 34 58 32 91 10 32 32 32 32 123 10 32 32 32 32 32 32 34 116 121 112 101 34 58 32 34 102 108 97 110 110 101 108 34 44 10 32 32 32 32 32 32 34 100 101 108 101 103 97 116 101 34 58 32 123 10 32 32 32 32 32 32 32 32 34 104 97 105 114 112 105 110 77 111 100 101 34 58 32 116 114 117 101 44 10 32 32 32 32 32 32 32 32 34 105 115 68 101 102 97 117 108 116 71 97 116 101 119 97 121 34 58 32 116 114 117 101 10 32 32 32 32 32 32 125 10 32 32 32 32 125 44 10 32 32 32 32 123 10 32 32 32 32 32 32 34 116 121 112 101 34 58 32 34 112 111 114 116 109 97 112 34 44 10 32 32 32 32 32 32 34 99 97 112 97 98 105 108 105 116 105 101 115 34 58 32 123 10 32 32 32 32 32 32 32 32 34 112 111 114 116 77 97 112 112 105 110 103 115 34 58 32 116 114 117 101 10 32 32 32 32 32 32 125 10 32 32 32 32 125 10 32 32 93 10 125 10]}: [plugin flannel does not support config version "" plugin portmap does not support config version ""]
Sep 19 06:33:49 master-1 kubelet[2168]: W0919 06:33:49.140577    2168 cni.go:237] Unable to update cni config: no valid networks found in /etc/cni/net.d
Sep 19 06:33:49 master-1 kubelet[2168]: E0919 06:33:49.612844    2168 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

根据 https://github.com/coreos/flannel/pull/1179 的讨论可以看出应该是已知的问题,应该是cni 版本的问题,

{
       "name": "cbr0",
+      "cniVersion": "0.3.1",
       "plugins": [
         {
           "type": "flannel",
           

解决方法

使用 https://github.com/coreos/flannel/blob/701c2e8749714022758d5360fbe627005901349c/Documentation/kube-flannel.yml
的 yml 部署 flannel 即可。

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/701c2e8749714022758d5360fbe627005901349c/Documentation/kube-flannel.yml

注意:
近期 raw 连接都打不开了,可以将 https://github.com/coreos/flannel/blob/701c2e8749714022758d5360fbe627005901349c/Documentation/kube-flannel.yml 的内容
复制到制定文件即可

你可能感兴趣的:(kubernetes)