calico网络报错calico/node is not ready: BIRD is not ready: BGP not established with

avatar 2023年3月8日18:31:32 评论 1,474 次浏览

原来的环境部署的是swarm集群,但是偷懒就没有把集群中的服务删除,直接安装了kubernetes,导致安装之后出现各种问题,安装成功之后只有一个节点的calico启动不了,显示的是运行状态,但是一直不能用。

 [root@master1 nfs]# kubectl get pod -A
 NAMESPACE                      NAME                                               READY   STATUS    RESTARTS      AGE
 kube-system                    calico-kube-controllers-5b9cd88b65-xrq97           1/1     Running   6 (70m ago)   109m
 kube-system                    calico-node-h8wp2                                  0/1     Running   0             8m24s
 kube-system                    calico-node-sww8s                                  1/1     Running   0             109m
 kube-system                    calico-node-wlghh                                  1/1     Running   0             109m
 kube-system                    coredns-6d8c4cb4d-lvzks                            1/1     Running   0             48m
 kube-system                    coredns-6d8c4cb4d-qgfsc                            1/1     Running   0             48m
 kube-system                    etcd-master1                                       1/1     Running   1 (69m ago)   113m

看一下日志的输出内容吧,我的master节点ip是50,node1节点是51,node2节点是52,提示的问题是“calico/node is not ready: BIRD is not ready: BGP not established with ”意思是节点为就绪,BGP与其他节点为建立链接。

 [root@master1 nfs]# kubectl describe pod -n kube-system calico-node-h8wp2
 Name:                 calico-node-h8wp2
 Namespace:            kube-system
 Priority:             2000001000
 Priority Class Name:  system-node-critical
 Node:                 master1/172.16.10.50
 Start Time:           Wed, 08 Mar 2023 15:57:06 +0800
 Labels:               controller-revision-hash=5749fbb7c8
                       k8s-app=calico-node
 ..................................................................
  Warning  Unhealthy  8m41s (x3 over 8m43s)  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  8m38s                  kubelet            Readiness probe failed: 2023-03-08 07:57:16.724 [INFO][198] 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.16.10.51,172.16.10.52
   Warning  Unhealthy  8m28s  kubelet  Readiness probe failed: 2023-03-08 07:57:26.714 [INFO][220] 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.16.10.51,172.16.10.52
   Warning  Unhealthy  8m18s  kubelet  Readiness probe failed: 2023-03-08 07:57:36.725 [INFO][257] confd/health.go 180: Number of node(s) with BGP peering established = 0                 

解决方法就是以前安装的服务中有docker的网卡没有用被占用了,所以可以看看那些网卡是down的状态然后删除即可。

 [root@master1 nfs]# ip link
 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
     link/ether 52:54:00:fb:cd:61 brd ff:ff:ff:ff:ff:ff
 3: br-3c46e9f23eaf: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
     link/ether 02:42:0b:fb:c2:fb brd ff:ff:ff:ff:ff:ff
 4: br-87a41ab93937: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
     link/ether 02:42:ab:0e:63:8f brd ff:ff:ff:ff:ff:ff
 5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
     link/ether 02:42:dc:85:88:40 brd ff:ff:ff:ff:ff:ff
 6: docker_gwbridge: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
     link/ether 02:42:d8:2e:ba:25 brd ff:ff:ff:ff:ff:ff
 7: tunl0@NONE: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
     link/ipip 0.0.0.0 brd 0.0.0.0
 8: cali5abcec17d26@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc noqueue state UP mode DEFAULT group default
     link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 0
 9: cali0a7ca7d001e@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc noqueue state UP mode DEFAULT group default
     link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 1
 10: cali8da29bca648@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc noqueue state UP mode DEFAULT group default
     link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 2
 11: cali2b88473c296@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc noqueue state UP mode DEFAULT group default
     link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 3
 [root@master1 nfs]# ip link delete br-87a41ab93937
 [root@master1 nfs]# ip link delete br-3c46e9f23eaf

删除之后在看一下集群的calico是否正常。

 [root@master1 ~]# kubectl get pod -A
 NAMESPACE                      NAME                                               READY   STATUS    RESTARTS       AGE
 default                        nfs-client-provisioner-76d55c77c6-s9ng9            1/1     Running   3 (50m ago)    56m
 kube-system                    calico-kube-controllers-5b9cd88b65-xrq97           1/1     Running   6 (147m ago)   3h6m
 kube-system                    calico-node-h8wp2                                  1/1     Running   0              85m
 kube-system                    calico-node-sww8s                                  1/1     Running   0              3h6m
 kube-system                    calico-node-wlghh                                  1/1     Running   0              3h6m
 kube-system                    coredns-6d8c4cb4d-lvzks                            1/1     Running   0              125m
 kube-system                    coredns-6d8c4cb4d-qgfsc                            1/1     Running   0              125m

异常节点启动成功,所有节点也正常了。好了,问题就写到这吧,没有了看看其他的吧。

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: