- 参考的calico官网,安装calico过程如下:
(1)、tigera-operator.yaml和custom-resources.yaml文件下载到服务器上
(2)、执行kubectl create -f tigera-operator.yaml,安装过程未报错
(3)、修改配置文件custom-resources.yaml,加入如下配置内容
nodeAddressAutodetectionV4:
interface: ens33
确定所有网卡是ens33
(4)、执行kubectl create -f custom-resources.yaml,安装过程未报错
(5)、查看calico相关pod,pod处于running状态
NAME READY STATUS RESTARTS AGE
calico-kube-controllers-6696b5fc97-hlb84 1/1 Running 0 2m33s
calico-node-28flc 1/1 Running 0 2m34s
calico-node-p9tcg 1/1 Running 0 2m34s
calico-typha-9f54f8447-sgpnl 1/1 Running 0 2m34s
csi-node-driver-67h28 2/2 Running 0 2m33s
csi-node-driver-wgwvs 2/2 Running 0 2m33s
(6)、执行7.
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
```,结果如下:
```xml
taint "node-role.kubernetes.io/control-plane" not found
taint "node-role.kubernetes.io/control-plane" not found
后查看pod状态也正常
2.查看calico pod相关信息始终报错:
Normal Pulling 27m kubelet Pulling image "docker.io/calico/pod2daemon-flexvol:v3.28.2"
Normal Scheduled 27m default-scheduler Successfully assigned calico-system/calico-node-rhrj9 to dk8s-work1
Normal Pulled 27m kubelet Successfully pulled image "docker.io/calico/pod2daemon-flexvol:v3.28.2" in 10.195808051s
Normal Created 27m kubelet Created container flexvol-driver
Normal Started 27m kubelet Started container flexvol-driver
Normal Pulling 27m kubelet Pulling image "docker.io/calico/cni:v3.28.2"
Normal Started 26m kubelet Started container install-cni
Normal Pulled 26m kubelet Successfully pulled image "docker.io/calico/cni:v3.28.2" in 51.718175648s
Normal Created 26m kubelet Created container install-cni
Normal Pulling 26m kubelet Pulling image "docker.io/calico/node:v3.28.2"
Normal Pulled 25m kubelet Successfully pulled image "docker.io/calico/node:v3.28.2" in 50.979018706s
Normal Created 25m kubelet Created container calico-node
Normal Started 25m kubelet Started container calico-node
Warning Unhealthy 25m kubelet Readiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to connect to BIRDv4 socket: dial unix /var/run/calico/bird.ctl: connect: connection refused
Warning Unhealthy 25m kubelet Readiness probe failed: 2024-11-06 07:59:09.401 [INFO][231] confd/health.go 202: Number of node(s) with BGP peering established = 0
calico/node is not ready: BIRD is not ready: BGP not established with 192.168.100.186
或:
Warning Unhealthy 42m kubelet Readiness probe failed: calico/node is not ready: BIRD is not ready: Error querying BIRD: unable to connect to BIRDv4 socket: dial unix /var/run/bird/bird.ctl: connect: no such file or directory
```xml
其它说明:
custom-resources.yaml即使不加入配置nodeAddressAutodetectionV4:
interface: ens33
也报同样的错误。
工作节点端口查看如下看上去似乎已经建立了连接:
netstat -ltunp | grep 179
tcp 0 0 0.0.0.0:179 0.0.0.0:* LISTEN 12607/bird
lsof -i:179
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bird 12607 root 7u IPv4 68970 0t0 TCP *:bgp (LISTEN)
bird 12607 root 8u IPv4 76064 0t0 TCP dk8s-work1:bgp->dk8s-work2:55595 (ESTABLISHED)
/var/run/bird/bird.ctl文件calico刚部署完是存在的,但是重启节点后不存在了
通过ip link命令查看没有br开头的多余虚拟网卡,并且删除了一部分state DOWN的网卡也没起作用,一直的bird的错误。
版本信息如下:OS:CENTOS7,
calico version:v3.28.2
K8S:v1.21.10
网上搜索了几个方法(如加入nodeAddressAutodetectionV4识别网卡的配置)均不起作用,请教如何处理此错误
补充内容:
```xml
1.ens33是正确配置在网卡上的IP地址,并且集群中无重复
[root@dk8s-work1 ~]# ip addr show ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:1b:c2:fb brd ff:ff:ff:ff:ff:ff
inet 192.168.100.185/24 brd 192.168.100.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::89d2:8fb4:d1c9:74f/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@dk8s-work2 ~]# ip addr show ens33
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:7e:94:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.100.186/24 brd 192.168.100.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::f470:3449:c28b:1f02/64 scope link noprefixroute
valid_lft forever preferred_lft forever
2.节点间通讯正常
[root@dk8s-work1 ~]# ping dk8s-work2
PING dk8s-work2 (192.168.100.186) 56(84) bytes of data.
64 bytes from dk8s-work2 (192.168.100.186): icmp_seq=1 ttl=64 time=0.455 ms
64 bytes from dk8s-work2 (192.168.100.186): icmp_seq=2 ttl=64 time=0.357 ms
64 bytes from dk8s-work2 (192.168.100.186): icmp_seq=3 ttl=64 time=0.288 ms
64 bytes from dk8s-work2 (192.168.100.186): icmp_seq=4 ttl=64 time=0.298 ms
64 bytes from dk8s-work2 (192.168.100.186): icmp_seq=5 ttl=64 time=0.287 ms
[root@dk8s-work2 ~]# ping dk8s-work1
PING dk8s-work1 (192.168.100.185) 56(84) bytes of data.
64 bytes from dk8s-work1 (192.168.100.185): icmp_seq=1 ttl=64 time=0.246 ms
64 bytes from dk8s-work1 (192.168.100.185): icmp_seq=2 ttl=64 time=0.300 ms
64 bytes from dk8s-work1 (192.168.100.185): icmp_seq=3 ttl=64 time=0.303 ms
64 bytes from dk8s-work1 (192.168.100.185): icmp_seq=4 ttl=64 time=0.240 ms
3.179端口节点间可以连接
[root@dk8s-work1 ~]# telnet 192.168.100.186 179
Trying 192.168.100.186...
Connected to 192.168.100.186.
Escape character is '^]'.
? d " @xA EFG
[root@dk8s-work2 ~]# telnet 192.168.100.185 179
Trying 192.168.100.185...
Connected to 192.168.100.185.
Escape character is '^]'.
? d " @xA EFG
4.日志
(1)、calico-node Pod 日志
2024-11-14 01:42:12.192 [INFO][58] felix/route_table.go 1153: Failed to get interface; it's down/gone. error=Link not found ifaceName="vxlan.calico" ifaceRegex="^vxlan.calico$" ipVersion=0x4
2024-11-14 01:42:12.192 [ERROR][58] felix/route_table.go 920: Failed to get link attributes error=interface not present ifaceRegex="^vxlan.calico$" ipVersion=0x4
2024-11-14 01:42:12.240 [INFO][58] felix/vxlan_mgr.go 425: Failed to get VXLAN tunnel device, assuming it isn't present error=Link not found
(2)、calico-kube-controllers Pod 日志
无错误内容
5.bird启动及命令无法使用
[root@dk8s-work1 ~]# systemctl start bird
Failed to start bird.service: Unit not found.
[root@dk8s-work1 ~]# birdc
bash: birdc: command not found...
6.calico版本降低了,无效;经查询目前所使用的CALICO版本与K8S版本是匹配的
7.custom-resources.yaml中改成默认找网卡还是报一样的错误