一、添加新master和node到k8s集群
1、首先在master上生成新的token
]# kubeadm token create --print-join-command
kubeadm join 172.31.182.156:8443 --token ortvag.ra0654faci8y8903 --discovery-token-ca-cert-hash sha256:04755ff1aa88e7db283c85589bee31fabb7d32186612778e53a536a297fc9010
2、在master上生成用于新master加入的证书
]# kubeadm init phase upload-certs --upload-certs
W0929 15:43:22.448397 94700 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
a7e372b631d4f2ac94c347ba368ea113e81b931ff71b69e24ddef1b0c05ca87d
3、添加新node
kubeadm join 192.168.239.130:8443 --token ortvag.ra0654faci8y8903 --discovery-token-ca-cert-hash sha256:04755ff1aa88e7db283c85589bee31fabb7d32186612778e53a536a297fc9010
4、添加新master,把红色部分加到–experimental-control-plane –certificate-key后。
kubeadm join 192.168.239.130:8443 --token ortvag.ra0654faci8y8903 \
--discovery-token-ca-cert-hash sha256:04755ff1aa88e7db283c85589bee31fabb7d32186612778e53a536a297fc9010 \
--control-plane --certificate-key f8d1c027c01baef6985ddf24266641b7c64f9fd922b15a32fce40b6b4b21e47d
评论前必须登录!
注册