当前位置: 首页 > news >正文

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

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

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

kubectl describe po -n calico-system  calico-node-bt6q2Warning  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 refusedWarning  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

查看路由

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的

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

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-ippoolblockSize: 26cidr: 10.244.0.0/16encapsulation: VXLANCrossSubnetnatOutgoing: EnablednodeSelector: 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即可

- name: CLUSTER_TYPEvalue: "k8s,bgp"# Specify interface- name: IP_AUTODETECTION_METHODvalue: "interface=网卡名"

 

相关文章:

  • electron主进程和渲染进程之间的通信
  • JAVA开发工具——IntelliJ IDEA
  • HikariCP数据库连接池原理解析
  • 数字证书_CA_详解
  • 007-nlohmann/json 项目应用-C++开源库108杰
  • 使用Node.js分片上传大文件到阿里云OSS
  • Spring Boot+Neo4j知识图谱实战:3步搭建智能关系网络!
  • 「数据分析 - Pandas 函数」【数据分析全栈攻略:爬虫+处理+可视化+报告】
  • 2025年渗透测试面试题总结-腾讯[实习]玄武实验室-安全工程师(题目+回答)
  • Redis 缓存策略:借助缓存优化数据库性能并保障数据一致性
  • 【Redis】zset 类型
  • EasyRTC音视频实时通话助力新一代WebP2P视频物联网应用解决方案
  • 129、QT搭建FFmpeg环境
  • 「深度拆解」Spring Boot如何用DeepSeek重构MCP通信层?从线程模型到分布式推理的架构进化
  • 稳定币的深度剖析与展望
  • 将HTML内容转换为Canvas图像,主流方法有效防止文本复制
  • 比特币:固若金汤的数字堡垒与它的四道防线
  • 白银6月想法
  • 【Redis从入门到精通实战文章汇总】
  • 蓝桥杯2118 排列字母
  • 济南市建设工程招标投标协会网站/专业网站建设
  • 文昌网站 做炸饺子/最新新闻国内大事件
  • 新网站制作怎么样/长沙seo外包优化
  • 如何开wordpress网站/南昌网优化seo公司
  • 阿里云企业网站备案/bt磁力搜索神器
  • php网站开发工具/百度登录入口官网