RKE2 Calico 指定网卡

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
Author

Warner Chen

Posted on

2024-11-27

Updated on

2024-11-27

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.