Docs/CloudNative/ErrorProcess/Calico异常.md
2022-10-18 16:59:37 +08:00

67 lines
No EOL
4.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

calico异常
```
kubectl get pod -n kube-system
```
显示
```
NAME READY STATUS RESTARTS AGE
calico-kube-controllers-744cfdf676-4qqph 1/1 Running 0 31m
calico-node-8jr59 0/1 Running 0 20s
calico-node-cs79v 0/1 Running 0 20s
calico-node-fkstd 0/1 Running 0 20s
coredns-7f89b7bc75-6md7d 1/1 Running 0 53m
coredns-7f89b7bc75-p88r5 1/1 Running 0 53m
etcd-kubernetes-master 1/1 Running 0 53m
kube-apiserver-kubernetes-master 1/1 Running 0 53m
kube-controller-manager-kubernetes-master 1/1 Running 0 53m
kube-proxy-6tfvm 1/1 Running 0 26m
kube-proxy-mgqv2 1/1 Running 0 26m
kube-proxy-v25vl 1/1 Running 0 53m
kube-scheduler-kubernetes-master 1/1 Running 0 53m
```
查看pod描述信息
```
kubectl describe pod calico-node-npjjr -n kube-system
```
显示
```
Warning Unhealthy 72s kubelet Readiness probe failed: 2020-12-18 13:55:29.276 [INFO][120] 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.17.0.9,172.17.0.3
Warning Unhealthy 62s kubelet Readiness probe failed: 2020-12-18 13:55:39.278 [INFO][156] 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.17.0.9,172.17.0.3
Warning Unhealthy 52s kubelet Readiness probe failed: 2020-12-18 13:55:49.283 [INFO][189] 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.17.0.9,172.17.0.3
Warning Unhealthy 42s kubelet Readiness probe failed: 2020-12-18 13:55:59.279 [INFO][215] 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.17.0.9,172.17.0.3
Warning Unhealthy 32s kubelet Readiness probe failed: 2020-12-18 13:56:09.280 [INFO][249] 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.17.0.9,172.17.0.3
Warning Unhealthy 22s kubelet Readiness probe failed: 2020-12-18 13:56:19.276 [INFO][276] 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.17.0.9,172.17.0.3
Warning Unhealthy 12s kubelet Readiness probe failed: 2020-12-18 13:56:29.276 [INFO][302] 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.17.0.9,172.17.0.3
Warning Unhealthy 2s kubelet Readiness probe failed: 2020-12-18 13:56:39.272 [INFO][335] 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.17.0.9,172.17.0.3
```
修改calico.yaml文件
```
/*
调整calicao 网络插件的网卡发现机制修改IP_AUTODETECTION_METHOD对应的value值。官方提供的yaml文件中ip识别策略IPDETECTMETHOD没有配置即默认为first-found这会导致一个网络异常的ip作为nodeIP被注册从而影响node-to-node mesh。我们可以修改成can-reach或者interface的策略尝试连接某一个Ready的node的IP以此选择出正确的IP。
*/
// calico.yaml 文件添加以下二行
- name: IP_AUTODETECTION_METHOD
value: "interface=ens.*" # ens 根据实际网卡开头配置
// 配置如下
- name: CLUSTER_TYPE
value: "k8s,bgp"
- name: IP_AUTODETECTION_METHOD
value: "interface=ens.*"
#或者 value: "interface=ens160"
# Auto-detect the BGP IP address.
- name: IP
value: "autodetect"
# Enable IPIP
- name: CALICO_IPV4POOL_IPIP
value: "Always"
```