K8S报错network is not ready: container runtime network not ready

最近部署K8S真是踩坑很多,尤其是安装很完美,各种报错,最严重的就是查看pod节点发现

coredns名字开头的两个pod是启动不了,如图。

 这问题是缺少配置文件

创建配置文件

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

猜你喜欢

转载自blog.csdn.net/qq_35002542/article/details/127656766
今日推荐