Add nodes
Describes how to add nodes to a KSV cluster.
This topic describes how to add nodes to a KubeSphere Virtualization (KSV) cluster.
KSV allows you to add nodes only. You cannot delete nodes from a KSV cluster. KSV supports the following methods to add nodes:
Prerequisites
Make sure the number of nodes you want to add does not exceed the resource quota of your KSV cluster. In single-node mode, KSV allows you to add another two nodes. If you want to add more nodes, we recommend that you purchase the Developer or Enterprise Edition. For more information about editions and resource quotas, see Editions.
Use the KSV web console to add nodes
Log in to the KSV web console as user admin.
In the top navigation bar, click Physical Resources to go to the management page of physical resources.
In the left-side navigation pane, choose Nodes > Physical Nodes.
In the upper-right corner of the Physical Nodes page, click Add to open the wizard to add a node.
In the dialog box that appears, configure the following parameters for the node that you want to add.
Parameter Description NameThe custom name of the node.The name can contain only lowercase letters, digits, and hyphens (-), and must start and end with a lowercase letter or a digit. The name can contain up to 16 characters in length.SSH LoginThe SSH login method of the node. KSV provides the following methods to add a node:- Username and Password: Log in to the server node using a username and its password.
- SSH Key: Log in to the server node using an SSH key.
UsernameThe username used for SSH login. This parameter is available only when SSH Login is set to Username and Password. By default, user root is used to log in to the server node.PasswordThe password used for SSH login. This parameter is available only when SSH Login is set to Username and Password.Internal IP AddressThe internal IP address of the node. This IP address is accessible to all nodes in the cluster.To specify multiple internal IP addresses, click Add.Click Add. The node appears in the node list after it is added.
common:NOTE
To view the progress of adding nodes, place the cursor in the lower-right corner of the page to open the toolbox and choose Upload Progress > Nodes.
(Optional) Run the following command to enable high availability:
ksv set-ceph-ha
If the following message appears, high availability is enabled:
set pool 2 size to 3
common:NOTE
Before you run the command to enable high availability, log in to the server node as user root and go the directory generated after the installation package is decompressed.
Use Terminal to add nodes
Log in to the server node on which KSV is installed as user root.
Go to the directory generated after the installation package is decompressed.
Run the following command to edit config-sample.yaml:
vi config-sample.yaml
Modify the hosts and roleGroups specifications in config-sample.yaml:
Sample code:
hosts: - {name: node1, address: 172.31.50.23, internalAddress: 172.31.50.23, user: yop, password: "zhu1241jie"} - {name: node2, address: 172.31.50.24, internalAddress: 172.31.50.24, user: yop, password: "zhu1241jie"} - {name: node3, address: 172.31.50.25, internalAddress: 172.31.50.25, user: yop, password: "zhu1241jie"} roleGroups: etcd: - node1 - node2 - node3 control-plane: - node1 - node2 - node3 worker: - node1 - node2 - node3 registry: - node1
The following table describes the parameters.
Parameter Description hostsA list of server nodes.nameThe name of the node.addressThe node IP address for SSH login.internalAddressThe internal IP address of the node.userThe username for SSH login. You must specify as user root or a user that has permissions to run sudo commands. If you leave this parameter empty, user root is specified by default.passwordThe password for SSH login.roleGroupsA list of node roles.etcdThe node on which etcd is installed. In most cases, etcd is installed on a control node.control-planeThe control node. You can configure multiple control nodes in the cluster.workerThe worker node. You can create VMs on worker nodes. In multi-node mode, a cluster must have at least three worker nodes. A control node can run as a worker node at the same time.registrySpecifies the node on which the registry is deployed. In most cases, the value is the first node in the cluster.Run the following command to add nodes:
./add-nodes.sh
If the following command output appears, the nodes are added:
Congratulations! Scaling cluster is successful.