wget https://github.com/projectcalico/calico/releases/download/v3.10.2/release-v3.10.2.tgz
tar xf release-v3.10.2.tgz
cd release-v3.10.2/k8s-manifests
sed -i 's?http://<ETCD_IP>:<ETCD_PORT>?https://192.168.0.62:2379,https://192.168.0.63:2379,https://192.168.0.64:2379?g' calico-etcd.yaml
cat /etc/etcdCA/etcd-key.pem|base64 -w 0 > ETCD-KEY
cat /etc/etcdCA/ca.pem|base64 -w 0 > ETCD-CA
cat /etc/etcdCA/etcd.pem|base64 -w 0 > ETCD-CERT
sed -i "s?# etcd-key: null?etcd-key: $(cat ETCD-KEY)?g" calico-etcd.yaml
sed -i "s?# etcd-ca: null?etcd-ca: $(cat ETCD-CA)?g" calico-etcd.yaml
sed -i "s?# etcd-cert: null?etcd-cert: $(cat ETCD-CERT)?g" calico-etcd.yaml
sed -i 's?etcd_ca: ""?etcd_ca: "/calico-secrets/etcd-ca"?g' calico-etcd.yaml
sed -i 's?etcd_cert: ""?etcd_cert: "/calico-secrets/etcd-cert"?g' calico-etcd.yaml
sed -i 's?etcd_key: ""?etcd_key: "/calico-secrets/etcd-key"?g' calico-etcd.yaml
sed -i 's?192.168.0.0/16?172.16.0.0/16?g' calico-etcd.yaml
kubectl apply -f calico-etcd.yaml
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐