Kubernetes node joining process¶
The Kubernetes node joining process is the procedure used to add new worker or control-plane nodes to an existing cluster. This process is primarily managed by the kubeadm tool, which streamlines the necessary authentication and configuration steps^[01.使用部署工具安装_Kubernetes.md].
Master initialization prerequisites¶
Before nodes can join, the cluster must be initialized on the master (control-plane) node. This involves running kubeadm init with specific parameters, such as the API server advertise address and Pod network CIDR^[01.使用部署工具安装_Kubernetes.md]. Upon successful initialization, the master node generates a bootstrap token and a CA certificate hash^[01.使用部署工具安装_Kubernetes.md]. These credentials are displayed in the output and are required for any node to establish a secure connection with the cluster^[01.使用部署工具安装_Kubernetes.md].
Executing the join command¶
To join the cluster, a worker node executes the kubeadm join command with the master's endpoint address, the token, and the discovery token CA cert hash^[01.使用部署工具安装_Kubernetes.md].
For example, the command syntax typically follows this structure^[01.使用部署工具安装_Kubernetes.md]:
kubeadm join cluster-endpoint:6443 --token <token> \
--discovery-token-ca-cert-hash sha256:<hash>
If the bootstrap token expires or is lost, administrators can generate a new join command on the master node using kubeadm token create --print-join-command^[01.使用部署工具安装_Kubernetes.md].
Node status and networking¶
After the join command is executed, the node will appear in the cluster's node list via kubectl get nodes, though it may initially report a status of NotReady^[01.使用部署工具安装_Kubernetes.md]. The node typically remains in this state until a Container Network Interface (CNI) plugin, such as [[Flannel]], is deployed and the Pod network is configured^[01.使用部署工具安装_Kubernetes.md].
Related Concepts¶
- Kubernetes
- [[Flannel]]
- [[kubeadm]]
Sources¶
01.使用部署工具安装_Kubernetes.md