k8s1.23 安装calico网络插件

发布时间 2023-06-06 10:46:02作者: 苦逼yw

1、下载

curl https://docs.projectcalico.org/manifests/calico.yaml -O

2、修改CIDR,添加图中内容。
该yaml文件中默认CIDR为192.168.0.0/16,需要与初始化时kube-config.yaml中的配置一致

vim calico.yaml

 3、指定网卡,添加图中内容。

 4、部署

kubectl apply -f calico.yaml

5、查看是否正常

kubectl get cs
[root@localhost k8s]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS    MESSAGE                         ERROR
controller-manager   Healthy   ok                              
scheduler            Healthy   ok                              
etcd-0               Healthy   {"health":"true","reason":""}