Add a Member Cluster via Direct Connection
This section describes how to add a member cluster via direct connection.
| Note |
|---|
Before being managed, a member cluster only needs to have Kubernetes installed; KubeSphere installation is not required. If KubeSphere is already installed, please migrate the data and uninstall KubeSphere before proceeding with management. |
Prerequisites
-
You need to have the platform-admin role in the host cluster.
-
All nodes in the host cluster must be able to access the Kubernetes API service of the member cluster (default is port 6443 on the master node of the member cluster). Depending on your network environment, you may need to configure firewall and traffic forwarding rules.
Obtain the Member Cluster kubeconfig
-
On a node of the member cluster, execute the following command to obtain the kubeconfig information of the member cluster:
kubectl config view --raw -
Copy the kubeconfig information and modify the clusters:cluster:server parameter as follows:
clusters: - cluster: server: https://<member-cluster-node-ip>:6443
Add a Member Cluster
-
Log in to the web console of the host cluster as a user with the platform-admin role.
-
Click Cluster Management.
-
On the Cluster Management page, click Add Cluster.
-
On the Basic Information tab, set the name, label, provider, and description for the member cluster, then click Next.
Parameter Description Name
The name of the member cluster. The name can only contain lowercase letters, numbers, and hyphens (-), must start and end with a lowercase letter or number, and can be up to 60 characters long.
Label
The label of the member cluster. You can select a label from the drop-down list or enter it manually.
Provider
The provider of the member cluster. You can select a provider from the drop-down list or enter it manually.
Description
The description of the member cluster. The description can contain any characters, with a maximum length of 256 characters.
Under Advanced Settings, set the usage identifier for the cluster.
-
On the Connection Settings tab, set Connection Mode to Direct Connection, enter the member cluster’s kubeconfig information in the kubeconfig area, and then click Next.
-
On the Cluster Configuration tab, configure the cluster settings, and then click Create.
Note In the cluster configuration, please change the image registry address to the actual registry address in use. The default is the official KubeSphere online registry address; please confirm it is accessible before using it.
After the member cluster is added, it will appear in the cluster list on the Cluster Management page.
Note After a member cluster is managed, if its KubeSphere version is inconsistent with the host cluster’s KubeSphere version, you need to manually upgrade KubeSphere on the member cluster nodes. Only after updating to the same KubeSphere version can subsequent operations be performed on the member cluster.