1.所有master节点安装kubelet,kubeadm,kubectl,docker
2.kubeadm单点安装:
kubeadm init --apiserver-advertise-address 192.168.1.2 --image-repository registry.cn-hangzhou.aliyuncs.com/google_containers --apiserver-cert-extra-sans 192.168.1.2,192.168.1.6 --control-plane-endpoint 192.168.1.2 --pod-network-cidr 10.222.0.0/16
3.生成秘钥:
kubeadm alpha certs certificate-key
4.将控制平面证书上传到集群
kubeadm init phase upload-certs --upload-certs --certificate-key=a8596fb1437aa26ebafe9b444ff0e2c335d4cd937e9a5e082cc1160e1e1768
5.添加master节点:
kubeadm join 192.168.1.2:6443 --token 5c35m1.qvzcxgpul9rxfa30 --discovery-token-ca-cert-hash sha256:337f4beb9e60b8b0d8236a9eddd6cc8e24e9436baa4217117e917451a674f50a --control-plane --certificate-key=a8596fb1437aa26ebafe9b444ff0e2c335d4cd937e9a5e082cc1160e1e176819
6.另外个master同理