calico/node is not ready: BIRD is not ready: BGP not established with xxx

发现calico有个节点没有正常运行

集群的某个节点没有Runing的报错内容

bash 复制代码
kubectl describe po -n calico-system  calico-node-bt6q2

  Warning  Unhealthy  61s (x2 over 62s)  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  36s                kubelet            Readiness probe failed: 2025-06-05 07:46:49.763 [INFO][406] node/health.go 202: Number of node(s) with BGP peering established = 1
calico/node is not ready: BIRD is not ready: BGP not established with xxx

查看路由

bash 复制代码
root@k8s-master:/home/k8s# kubectl exec -it -n calico-system calico-node-bt6q2 -- grep 'router id' /etc/calico/confd/config/bird.cfg
Defaulted container "calico-node" out of: calico-node, flexvol-driver (init), install-cni (init)
router id 10.4.0.1;

正常情况是要返回本机ip的

bash 复制代码
kubectl exec -it -n calico-system calico-node-bt6q2 -- grep 'router id' /etc/calico/confd/config/bird.cfg
Defaulted container "calico-node" out of: calico-node, flexvol-driver (init), install-cni (init)
router id 10.4.0.1;
root@k8s-master:/home/k8s# kubectl exec -it -n calico-system calico-node-2zvg9 -- grep 'router id' /etc/calico/confd/config/bird.cfg
Defaulted container "calico-node" out of: calico-node, flexvol-driver (init), install-cni (init)
router id 10.231.xxx;
root@k8s-master:/home/k8s# kubectl exec -it -n calico-system calico-node-rwlsx -- grep 'router id' /etc/calico/confd/config/bird.cfg
Defaulted container "calico-node" out of: calico-node, flexvol-driver (init), install-cni (init)
router id 10.231.xxx; 

这是典型的 Calico 自动探测主机 IP 不一致导致的 router ID 异常

Calico 默认使用first-found探测模式,会找"第一个符合条件"的非回环、非 docker 网卡的 IP。有时会因为以下因素导致

出现 router id = 10.4.0.1 的可能原因:

1、节点的第一个网卡是cni0、docker0或者nerdctl0这类虚拟网卡;

2、节点的主机 IP 没有被正确识别(例如没有绑定在主网卡上,或者主网卡排序靠后);

3、节点上的容器网络配置与其它节点略有不同(如顺序或网卡名);

4、没有通过IP_AUTODETECTION_METHOD 限定只选物理网卡,导致探测机制选错。

由于我是通过tigera-operator部署的,所以需要修改installation default

bash 复制代码
cat custom-resources.yaml 
# This section includes base Calico installation configuration.
# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.Installation
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
  name: default
spec:
  # Configures Calico networking.
  registry: 仓库地址
  imagePath: 仓库路径
  calicoNetwork:
    nodeAddressAutodetectionV4:
      interface: "bond0"
    ipPools:
    - name: default-ipv4-ippool
      blockSize: 26
      cidr: 10.244.0.0/16
      encapsulation: VXLANCrossSubnet
      natOutgoing: Enabled
      nodeSelector: all()

---

# This section configures the Calico API server.
# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.APIServer
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
  name: default
spec: {}

重启

kubectl delete -f custom-resources.yaml

kubectl apply -f custom-resources.yaml

恢复正常

如果不是我的方法部署的相同的道理

那就修改calico.yaml,apply即可

bash 复制代码
- name: CLUSTER_TYPE
              value: "k8s,bgp"
            # Specify interface
            - name: IP_AUTODETECTION_METHOD
              value: "interface=网卡名"
相关推荐
亿牛云爬虫专家3 小时前
Kubernetes下的分布式采集系统设计与实战:趋势监测失效引发的架构进化
分布式·python·架构·kubernetes·爬虫代理·监测·采集
乌鸦不像写字台4 小时前
【docker部署】在服务器上使用docker
服务器·docker·容器
互联网搬砖老肖5 小时前
运维打铁: MongoDB 数据库集群搭建与管理
运维·数据库·mongodb
Antonio9156 小时前
【音视频】HLS简介与服务器搭建
运维·服务器·音视频
艾伦_耶格宇7 小时前
【docker】-1 docker简介
运维·docker·容器
R.X. NLOS7 小时前
VS Code远程开发新方案:使用SFTP扩展解决Remote-SSH连接不稳定问题
运维·服务器·ssh·debug·vs code
cuijiecheng20188 小时前
Ubuntu下布署mediasoup-demo
linux·运维·ubuntu
IvanCodes8 小时前
二、Docker安装部署教程
docker·容器
Andy杨11 小时前
20250707-4-Kubernetes 集群部署、配置和验证-K8s基本资源概念初_笔记
笔记·容器·kubernetes
jingyu飞鸟11 小时前
linux系统源代码安装apache、编译隐藏版本号
linux·运维·apache