使用KUBE-VIP部署高可用k8s
# 创建自动部署清单
docker run --network host --rm swr.cn-south-1.myhuaweicloud.com/vp-whdev/all-in-devops/kube-vip:v0.6.0 manifest pod --interface=eth0 --vip 172.18.41.242 --controlplane --services --arp --leaderElection | tee /etc/kubernetes/manifests/kube-vip.yaml
# 安装
kubeadm init --control-plane-endpoint "kube-api-server:6443" --image-repository registry.aliyuncs.com/google_containers --upload-certs --kubernetes-version v1.20.15 --pod-network-cidr 10.244.0.0/16 --v 5
# 打印master加入节点命令
echo "$(kubeadm token create --print-join-command) --control-plane --certificate-key $(kubeadm init phase upload-certs --upload-certs | tail -1)"
# 打印node加入节点命令
kubeadm token create --print-join-command
# 复制kube-vip.yaml到每一台机器
cp kube-vip.yaml /etc/kubernetes/manifests