To ensure that each nodes in the cluster contain the hosts configuration of other nodes, all nodes will execute the operating system initialization script before adding a new node.
This approach can lead to adding nodes failures due to issues such as existing nodes being unable to connect.
Therefore, it is necessary to optimize the current logic.
One solution is to only perform the operating system initialization process on the new nodes to be added before adding to cluster, and then synchronize the latest hosts configuration to the other nodes in the cluster after the nodes has been added. This approach can help to avoid adding node failures in emergency situations.
Currently, the main steps in the operating system initialization process include:
https://github.com/kubesphere/kubekey/blob/master/cmd/kk/pkg/bootstrap/os/templates/init_script.go
To ensure that each nodes in the cluster contain the hosts configuration of other nodes, all nodes will execute the operating system initialization script before adding a new node.
This approach can lead to adding nodes failures due to issues such as existing nodes being unable to connect.
Therefore, it is necessary to optimize the current logic.
One solution is to only perform the operating system initialization process on the new nodes to be added before adding to cluster, and then synchronize the latest hosts configuration to the other nodes in the cluster after the nodes has been added. This approach can help to avoid adding node failures in emergency situations.
The same issue: https://github.com/kubesphere/kubekey/issues/1638