# 编辑hosts文件,末尾新增node03节点[root@master01~]# vi /etc/hosts......192.168.34.40 node03
# 分发hosts文件至所有节点[root@master01~]# for H in master0{2..3}; do scp /etc/hosts root@$H:/etc/; done[root@master01~]# for H in node0{1..3}; do scp /etc/hosts root@$H:/etc/; done
[root@node03~]# kubeadm join master:64430 --token wwpl04.uzwhpnttjahiopw5 --discovery-token-ca-cert-hash sha256:503e9566a6b17fe9560d42b0fdc5be01c18671808363891ed130adff2298d01f[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
This node has joined the cluster:* Certificate signing request was sent to apiserver and a response was received.* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the control-plane to see this node join the cluster.
3.3 查看结果
[root@master01~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master01 Ready control-plane,master 23h v1.22.2
master02 Ready control-plane,master 22h v1.22.2
master03 Ready control-plane,master 22h v1.22.2
node01 Ready <none> 22h v1.22.2
node02 Ready <none> 22h v1.22.2
node03 Ready <none> 52s v1.22.2