1.生成添加node节点token
kubeadm token create --print-join-command
结果示例
kubeadm join 10.10.10.10:6443 --token xxxxxx.xxx...xxx --discovery-token-ca-cert-hash sha256:xxxxx...xxxxb
2.在master上生成用于新master加入的证书获取Using certificate key
kubeadm init phase upload-certs --experimental-upload-certs
结果示例
[root@master ~]# kubeadm init phase upload-certs --experimental-upload-certs
...
...
[upload-certs] Using certificate key:
e799a655f667fc327ab8c91f4f2541b57b96d2693ab5af96314ebddea7a68526
添加node,执行1步骤生成的命令
命令示例
kubeadm join 10.10.10.10:6443 --token xxxxxx.xxx...xxx --discovery-token-ca-cert-hash sha256:xxxxx...xxxx
添加master,把1步骤的命令后面加上 --experimental-control-plane --certificate-key 末尾加上2步骤生成的Using certificate key。
命令示例
kubeadm join 10.10.10.10:6443 --token xxxxxx.xxx...xxx --discovery-token-ca-cert-hash sha256:xxxxx...xxxx --experimental-control-plane --certificate-key xxx...xxx
标签:...,--,xxx,token,集群,10.10,kubeadm,节点
From: https://www.cnblogs.com/wes1502/p/17603431.html