k8s 宿主机网网卡问题导致pod起不来处理方案

现象:

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日志报错:Number of node(s) with BGP peering established = 0 calico/node is not ready: BIRD is

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状态

 

上一篇:Java基础学习笔记 Chapter05


下一篇:剑指 Offer 57 - II. 和为s的连续正数序列