使用k8s的过程中,发现一台曾经安装过harbor(后来清理掉了)的服务器的calico组件一直报错:

2020-03-19 07:11:07.934 [INFO][11] startup.go 572: Using autodetected IPv4 address on interface br-11af8abf2c68: 172.19.0.1/16
2020-03-19 07:11:07.934 [INFO][11] startup.go 440: Node IPv4 changed, will check for conflicts
2020-03-19 07:11:07.942 [WARNING][11] startup.go 851: Calico node 'node1' is already using the IPv4 address 172.19.0.1.
2020-03-19 07:11:07.942 [INFO][11] startup.go 198: Clearing out-of-date IPv4 address from this node IP="172.19.0.1/16"
2020-03-19 07:11:07.953 [WARNING][11] startup.go 1004: Terminating

其中br-11af8abf2c68是一个网桥,可是安装过程中,并未配置网桥。于是仔细检查,发现这是由harbor安装的,造成了calico网络的混乱,于是执行如下操作:

root@node1:~# docker network ls
NETWORK ID          NAME                                  DRIVER              SCOPE
4b4c7575bfe9        bridge                                bridge              local
bfe39862a83f        harbor-arm64-193_harbor               bridge              local
17676ffcbc56        harbor-arm64-193_harbor-chartmuseum   bridge              local
1ce62bb8f687        host                                  host                local
3d97578ea0f5        make_harbor                           bridge              local
62111cce557a        make_harbor-chartmuseum               bridge              local
8877ee09ebf1        none                                  null                local

发现果然有harbor遗存,执行如下操作进行删除

root@node1:~# docker network remove bfe39862a83f
bfe39862a83f
root@node1:~# docker network remove 17676ffcbc56
17676ffcbc56
root@node1:~# docker network remove 3d97578ea0f5
3d97578ea0f5
root@node1:~# docker network remove 62111cce557a
62111cce557a

再执行docker network ls已经看不到harbor的网桥了

重启calico对应的pod,故障消除

 

另外,还有个删除网桥的脚本,仅供参考

#!/bin/bash

for i in `ifconfig|grep br-|awk {'print $1'}`
do
    `ifconfig $i down`
    `brctl delbr $i`
echo $i
done

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐