systemctl status k0sworker

Container runtime network not ready\” networkReady=\”NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized

  • 查看节点信息 k0s kubectl describe node node6

处理方法二:实测有效

https://github.com/flannel-io/flannel/issues/1236

cat <<EOL > /etc/cni/net.d/10-flannel.conflist 
{
  "name": "cbr0",
  "cniVersion": "0.3.1",
  "plugins": [
    {
      "type": "flannel",
      "delegate": {
        "hairpinMode": true,
        "isDefaultGateway": true
      }
    },
    {
      "type": "portmap",
      "capabilities": {
        "portMappings": true
      }
    }
  ]
}
EOL

#查看
cat /etc/cni/net.d/10-flannel.conflist 
ifconfig cni0

处理方法一:

mkdir /etc/cni
mkdir -p /etc/cni/net.d
echo 
cat <<EOL > /etc/cni/net.d/10-kuberouter.conflist
{"cniVersion":"0.3.0","name":"mynet","plugins":[{"auto-mtu":true,"bridge":"kube-bridge","ipam":{"subnet":"10.244.0.0/24","type":"host-local"},"isDefaultGateway":true,"mtu":1480,"name":"kubernetes","type":"bridge"},{"capabilities":{"portMappings":true,"snat":true},"mtu":1480,"type":"portmap"}]}
EOL