现象:

kube-system calico-node-2622l 0/1 Running 2 21h
kube-system calico-node-jqswg 1/1 Running 1 21h
kube-system calico-node-mc4rb 1/1 Running 2 21h
kube-system calico-node-t4zrz 0/1 CrashLoopBackOff

pod日志报错:kubelet  Readiness probe failed: calico/node is not ready: BIRD is not ready: BGP not established with 192.168.1.10,192.168.1.12,192.168.1.14,192.168.1.15,192.168.1.162021-08-31 00:01:49.584 [INFO][228] health.go 114: Number of node(s) with BGP peering established = 0

1.通过calicoctl 工具查看 节点网络状态

[root@k8s-master-01 ~]# calicoctl node status
Calico process is running.

IPv4 BGP status
+--------------+-------------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+-------------------+-------+----------+-------------+
| 192.168.1.11 | node-to-node mesh | up | 03:57:45 | Established |
| 192.168.1.12 | node-to-node mesh | wait | 03:57:43 | Established |
| 192.168.1.14 | node-to-node mesh | wait | 03:57:43 | Established |
| 192.168.1.15 | node-to-node mesh | start | 03:57:41 | Passive |
| 192.168.1.16 | node-to-node mesh | start | 03:57:41 | Passive |
+--------------+-------------------+-------+----------+-------------+

备注:UP状态: 正常的 ,wait状态: 等待镜像下载完成 ,start状态网络异常   PEER ADDRESS:节点ip 

2.出现这个问题是由于节点多网卡引起的,所以直接修改calico.yaml 文件

添加:- name: IP_AUTODETECTION_METHOD
             value: "interface=ens*"

# Cluster type to identify the deployment type
- name: CLUSTER_TYPE
   value: "k8s,bgp"
- name: IP_AUTODETECTION_METHOD
   value: "interface=ens*"

更新:kubeclt apply -f  calico.yaml

查看 kubectl get pods -A  pod状态

或者命令执行:kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=interface=ens*

 

posted on 2021-07-23 12:26  MhaiM  阅读(696)  评论(0编辑  收藏  举报