【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

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

上一篇:docker使用portainer


下一篇:本地使用git拉取远程指定分支代码