【Vegas原創】k8s添加新master或node


Master

1,在master上生成新的token

[root@it-1c2d ~]# kubeadm token create --print-join-command
kubeadm join k8s.test:6443 --token apzooq.r9zivb2vaakn72k7     --discovery-token-ca-cert-hash sha256:255fc6a65316054aa5f1bfd92467ebce52f557983f5e901663a3a460af2c60b5

2,在master上生成用於新master加入的證書

[root@it-1c2d ~]# kubeadm init phase upload-certs --upload-certs
I0709 14:01:24.232720    5729 version.go:254] remote version is much newer: v1.21.2; falling back to: stable-1.20
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
911682ede59903ec2f7968e64110dfaea58e0c0abbab01e01ab5dc45f17d1d7b


另外一台要裝master的機器:

1,安裝k8s

https://www.cnblogs.com/amadeuslee/p/14985562.html

2,copy  master 步驟1的join 命令  ,--certificate-key后加入步驟2 的命令, 紅底標記。

kubeadm join k8s.test:6443 --token apzooq.r9zivb2vaakn72k7     --discovery-token-ca-cert-hash sha256:255fc6a65316054aa5f1bfd92467ebce52f557983f5e901663a3a460af2c60b5 --control-plane --certificate-key 911682ede59903ec2f7968e64110dfaea58e0c0abbab01e01ab5dc45f17d1d7b


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM