calico-node 的 IP_AUTODETECTION_METHOD 默认使用 first-found,如果节点存在多张网卡的时候,可能导致 calico-node 绑定到错误的网卡上,导致跨节点网络不通。
可以通过修改 IP_AUTODETECTION_METHOD 为 interface 或者 cidrs 来指定 calico-node 绑定到指定网卡上。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| cat <<EOF | kubectl apply -f - apiVersion: helm.cattle.io/v1 kind: HelmChartConfig metadata: name: rke2-calico namespace: kube-system spec: valuesContent: |- global: cattle: clusterId: "xxx" installation: calicoNetwork: nodeAddressAutodetectionV4: interface: "ens34" # 也可以使用 cidrs,interface 和 cidrs 不能同时使用 cidrs: - "172.16.16.0/24" EOF
|