[root@k8s-master ~]# kubectl apply -f calico.yaml
# 查看k8s集群的pod,发现网络插件calico的pod虽然是running的,但是该pod不能提供服务。
[root@k8s-master ~]# kubectl get pod -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-578894d4cd-gxfw2 1/1 Running 0 82m
kube-system calico-node-jzjj5 0/1 Running 0 15s
kube-system calico-node-vwfrr 0/1 Running 0 15s
kube-system coredns-7ff77c879f-nr8ln 1/1 Running 0 82m
kube-system coredns-7ff77c879f-tgr6m 1/1 Running 0 82m
kube-system etcd-k8s-master 1/1 Running 0 82m
kube-system kube-apiserver-k8s-master 1/1 Running 0 82m
kube-system kube-controller-manager-k8s-master 1/1 Running 0 82m
kube-system kube-proxy-r5vtk 1/1 Running 0 82m
kube-system kube-proxy-tcmtb 1/1 Running 0 82m
kube-system kube-scheduler-k8s-master 1/1 Running 0 82m
# 通过describe查看pod的启动信息
[root@k8s-master ~]# kubectl describe pod -n kube-system calico-node-jzjj5 | tail -n 20
Normal Created 23s kubelet, k8s-node1 Created container calico-node
Normal Started 23s kubelet, k8s-node1 Started container calico-node
Warning Unhealthy 14s kubelet, k8s-node1 Readiness probe failed: 2020-08-10 12:53:52.663 [INFO][134] 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 192.168.1.191
Warning Unhealthy 4s kubelet, k8s-node1 Readiness probe failed: 2020-08-10 12:54:02.684 [INFO][176] confd/health.go 180: Number of node(s) with BGP peering established = 0
解决的办法:
1、报错显示,pod启动calico-node容器报错了
2、在calico.yaml文件的calico-node位置添加一个启动参数:
# 识别网卡
- name: IP_AUTODETECTION_METHOD
value: "interface=ens.*"