环境准备
查看节点状态
$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
calico-vxlan-control-plane NotReady control-plane,master 3m59s v1.23.17 172.18.0.4 <none> Debian GNU/Linux 12 (bookworm) 6.5.0-35-generic containerd://1.7.13
calico-vxlan-worker NotReady <none> 3m19s v1.23.17 172.18.0.2 <none> Debian GNU/Linux 12 (bookworm) 6.5.0-35-generic containerd://1.7.13
calico-vxlan-worker2 NotReady <none> 3m32s v1.23.17 172.18.0.3 <none> Debian GNU/Linux 12 (bookworm) 6.5.0-35-generic containerd://1.7.13
下载 Calico 清单文件
$ wget https://raw.githubusercontent.com/projectcalico/calico/v3.25.2/manifests/calico-vxlan.yaml
编辑calico-vxlan.yaml
文件,修改以下配置
4574 # Enable or Disable VXLAN on the default IP pool.
4575 - name: CALICO_IPV4POOL_VXLAN
4576 value: "Always"
应用清单文件
$ kubectl apply -f ./calico-vxlan.yaml
查看创建的 Pod
$ kubectl -n kube-system get pod -l k8s-app=calico-node
NAME READY STATUS RESTARTS AGE
calic