解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

测试环境由于机房断电,导致对应虚拟机暴力重启,之后所在k8s服务error,查看系统日志,发现k8s三个节点的flannel文件均丢失。

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

  1.首先我们重新配置k8s的flannel文件,可以参考其他环境的文件配置,也可以重新安装插件生成,会在/run下面生成flannel文件夹,下面包含网络配置环境变量

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

  注明:三个节点的subnet网段不能相同

2.重配flannel之后发现,有两个节点依然不能分配网络,导致服务error

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

  查看error的pod日志,发现报错,对应节点的cni网络冲突

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

  3.查看出错节点cni0的网卡配置,发现cni0的这个网卡地址是10.244.2.1,明显与报错中的10.244.1.1不一致

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

  4.我们可以将其改为10.244.1.1,也可将这个错误的网卡删掉,它会自己重建,这里采用删除重生的方法,首先停用网络,然后删除配置

ifconfig cni0 down    
ip link delete cni0

然后查看节点重建的cni0网卡,会依据flannel的网络环境配置生成

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

  5.查看集群环境服务,系统恢复。

 

转自

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"_ST_君华的博客-CSDN博客
https://blog.csdn.net/Wuli_SmBug/article/details/104712653

解决k8s"failed to set bridge addr: "cni0" already has an IP address different from 10.244.1.1/24"【转】

上一篇:swing之常见组件


下一篇:WebAPI相关知识