When you use KubeSphere for a certain time, most likely you need to scale out your cluster with workloads increasing. In this scenario, KubeSphere provides script to add new nodes to the cluster. Fundamentally the operation is based on Kubelet's registration mechanism, i.e., the new nodes will automatically join the existing Kubernetes cluster.
Please note if the environment is installed with the all-in-one mode, it is not allowed to add new nodes to the single-node cluster.
KubeSphere supports hybrid environment, which means the newly added host OS can be CentOS or Ubuntu. When a new machine is ready, add a line of parameters about the new machine information in the group
kube-node of the file
conf/hosts.ini. More specifically, please list all nodes under [all] and put the new node under [kube-node] as well. If you are going to add multiple hosts, add corresponding lines of parameters to the file. It is not allowed to modify the host name of the existing nodes (e.g. master, node1, and node2) when you add a new node.
The following section shows adding a new node (i.e. node3) using
root user as an example.
[all] master ansible_connection=local ip=192.168.0.1 node1 ansible_host=192.168.0.2 ip=192.168.0.2 ansible_ssh_pass=PASSWORD node2 ansible_host=192.168.0.3 ip=192.168.0.3 ansible_ssh_pass=PASSWORD node3 ansible_host=192.168.0.4 ip=192.168.0.4 ansible_ssh_pass=PASSWORD ··· [kube-node] node3 ···
Note: You need to turn off
firewall yourself for new nodes.
add-nodes.sh script in the scripts directory.
Finally, you will be able to see the new node information on the KubeSphere console after a successful return. Select Infrastructure → Nodes from the left menu, or using
kubectl get node command can also see the changes.
Similarly, if you need to cordon or suspend nodes in the cluster for some reasons, such as hardware upgrades, hardware maintenance, etc., you can choose Infrastructure → Nodes from the menu, then click the Cordon button. Please see Node Management for further information.