calico bgp 模式启动失败,报错 BIRD is not ready
先说原因,calico 官方的 yaml 没有把
IP_AUTODETECTION_METHOD这个 IP 检测方法的参数放入calico.yaml中,calico 会使用第一个找到的network interface(往往是错误的 interface),导致 calico 把 master 也算进 nodes,于是 master BGP 启动失败,而其他 workers 则启动成功
calico 的报错内容
下面的 ip 我就和谐一下了
Warning Unhealthy 4m33s (x34673 over 4d) kubelet (combined from similar events): Readiness probe failed: 2024-04-07 02:40:13.153 [INFO][31446] confd/health.go 180: Number of node(s) with BGP peering established = 0
calico/node is not ready: BIRD is not ready: BGP not established with 172.17.xxx.xxx,172.17.xxx.xxx
查看路由
calico-node-xxxxx 替换成失败的 calico pod 名字
k exec -it -n kube-system calico-node-xxxxx -- grep 'router id' /etc/calico/confd/config/bird.cfg
返回下面的 ip 说明路由有问题,正常的路由,是本机的 ip 地址
router id 172.19.0.1
修改 calico yaml 文件
eth0 改成自己的网卡名称
- name: IP_AUTODETECTION_METHOD
value: "interface=eth0"
确认是否有下面的内容
- name: CLUSTER_TYPE
value: "k8s,bgp"
重新 apply calico 的 yaml 文件

浙公网安备 33010602011771号