Adding and Editing a Host Cluster
The Basic Resources page displays host clusters and Kubernetes clusters (available soon), to be deployed. You can create basic resources and import them to an application for deployment. A target host is the final deployment object. CodeArts Deploy deploys your resources such as artifacts to the target host in the environment. A proxy server is a computer used to provide access channels for other target hosts without public IP addresses. In CodeArts Deploy, proxy hosts are usually referred to as ECSs bound to public IP addresses unless otherwise specified.
Prerequisites
- You have the permission to edit projects. If you do not have the permission, contact the project administrator to grant the permission.
- A project is available. If no project is available, create one.
- A host is available. If no host is available, see Applying for an ECS.
- The proxy has been configured by referring to Configuring a Proxy Host and Security Configuration.
- The target host has been configured by referring to Configuring a Target Host and Security Configuration.
Creating a Cluster
- Go to the Basic Resources page.
In the target project, choose Settings > General > Basic Resources. The Host Cluster page is displayed.
- Create a host cluster.
Click Create Host Cluster, enter the following information, and click Save.
Parameter
Mandatory
Description
Cluster Name
Yes
Enter a user-defined host cluster name.
OS
Yes
Choose Linux or Windows as the operating system for the host.
Host Connection Mode
Yes
- Direct connection: Select a host bound with an EIP as the target host to connect to CodeArts.
- Proxy: Select a host bound with an EIP as the proxy host to connect to CodeArts.
If the target host cannot connect to the public network, select the proxy mode.
Execution Resource Pool
Yes
A resource pool is a collection of physical environments where commands are executed during software package deployment. You can use an official resource pool hosted by Huawei Cloud or host your own servers as a self-hosted resource pool on Huawei Cloud. For details about hosting your own servers, see Self-hosted Resource Pool.
Description
No
Description of the host cluster.
To use a Self-hosted resource pool, perform the following operations:
- Configure a Self-hosted resource pool by referring to Self-hosted Resource Pool.
- On the Basic Information tab page of the target application, select Self-hosted for Execution Host.
- (Optional) If Host Connection Mode is set to Proxy, you need to add a proxy host and a target host.
- Create a proxy host.
Click Add Host, select Adding IP for Add Hosts by, enter the following information, and click OK. The proxy host is created.
Table 1 Parameters of the proxy host (Linux) Parameter
Mandatory
Description
Host Name
Yes
Enter a user-defined proxy host name.
IP
Yes
Enter a public IP address bound to the proxy host.
OS
Yes
The default value is the OS of the current host cluster and cannot be changed.
Authorization
Yes
Select a password or key for authentication as required.
- If you select Password, the Username and Password are displayed. Take ECS as an example. You need to enter the ECS username and password.
- If you select Key, the Username and Key are displayed. For details about how to generate and obtain a key, see Obtaining the Linux key.
SSH Port
Yes
Port 22 is recommended. You may customize the port number.
Table 2 Parameters of the proxy host (Windows) Parameter
Mandatory
Description
Host Name
Yes
Enter a user-defined proxy host name.
IP
Yes
Enter a public IP address bound to the proxy host.
OS
Yes
The default value is the OS of the current host cluster and cannot be changed.
Authorization
Yes
Windows proxies support only password authentication. Take ECS as an example. You need to enter the ECS username and password.
Winrm Port
Yes
Port 5986 is recommended. You may customize the port number.
- Add a target host.
Click Add Host, select Adding IP for Add Hosts by, enter the following information, and click OK. The target host is created.
Table 3 Parameters of the target host (Linux) Parameter
Mandatory
Description
Host Name
Yes
Enter a user-defined target host name.
Proxy Host
Yes
Select the target proxy host as the network proxy of the target host that cannot connect to the public network.
IP
Yes
Enter the private or public IP address of the target host.
OS
Yes
The default value is the OS of the current host cluster and cannot be changed.
Authorization
Yes
Select a password or key for authentication as required.
- If you select Password, the Username and Password are displayed. Take ECS as an example. You need to enter the ECS username and password.
- If you select Key, the Username and Key are displayed. For details about how to generate and obtain a key, see Obtaining the Linux key.
SSH Port
Yes
Port 22 is recommended. You may customize the port number.
Table 4 Parameters of the target host (Windows) Parameter
Mandatory
Description
Host Name
Yes
Enter a user-defined target host name.
Proxy Host
Yes
Select the target proxy host as the network proxy of the target host that cannot connect to the public network.
IP
Yes
Enter the private or public IP address of the target host.
OS
Yes
The default value is the OS of the current host cluster and cannot be changed.
Authorization
Yes
Windows proxies support only password authentication. Take ECS as an example. You need to enter the ECS username and password.
Proxy Forwarding Port
Yes
Set this port to the listening port number in the Windows proxy configuration. Port 54 is recommended. User-defined ports are supported.
- Create a proxy host.
- (Optional) If Host Connection Mode is set to Direct Connection, you only need to add a target host.
Click Add Host, select Adding IP for Add Hosts by, enter the following information, and click OK. The target host is created.
Table 5 Parameters of the target host (Linux) Parameter
Mandatory
Description
Host Name
Yes
Enter a user-defined target host name.
IP
Yes
Enter the public IP address bound to the target host.
OS
Yes
The default value is the OS of the current host cluster and cannot be changed.
Authorization
Yes
Select a password or key for authentication as required.
- If you select Password, the Username and Password are displayed. Take ECS as an example. You need to enter the ECS username and password.
- If you select Key, the Username and Key are displayed. For details about how to generate and obtain a key, see Obtaining the Linux key.
SSH Port
Yes
Port 22 is recommended. You may customize the port number.
Table 6 Parameters of the target host (Windows) Parameter
Mandatory
Description
Host Name
Yes
Enter a user-defined target host name.
IP
Yes
Enter the public IP address bound to the target host.
OS
Yes
The default value is the OS of the current host cluster and cannot be changed.
Authorization
Yes
Windows proxies support only password authentication. Take ECS as an example. You need to enter the ECS username and password.
Winrm Port
Yes
Port 5986 is recommended. You may customize the port number.
- (Optional) You can also select Importing ECS for Add Hosts by and add your Huawei Cloud ECS as the target host or proxy host.
- Verify the host connectivity.
After the host is created, the system automatically verifies the connectivity. If the connectivity verification fails, click Failed and rectify the fault based on the failure cause displayed in the dialog box or click View Solution.
You should meet the following requirements to import purchased ECS:
- ECS is running.
- ECS and host cluster have the same OS.
- Proxy host has a public IP (proxy mode) when using official resource pool.
- Host is not the imported target host.
In the proxy mode, you need to configure the proxy host before using the target host.
Editing a cluster
- Go to the host cluster page.
- In the target project, choose Settings > General > Basic Resources. The Host Cluster page is displayed.
- Click the target host cluster to enter its details page.
- Edit a host cluster.
- Adding a host: Click in the Operation column of a cluster to add a host to the cluster.
- Editing a cluster: Click in the Operation column of a cluster to modify the cluster name, execution host, and description.
- Deleting a cluster: Click in the Operation column of a cluster, click Delete, and click OK.
If the target cluster contains resources, you need to clear all resources in the cluster and then delete the cluster.
- Managing Permissions: Click in the Operation column of a cluster, click Manage Permissions, and configure operation permissions for each role. Enable or disable permissions as required.
Default Permissions of a Host Cluster
Role/Permission
View
Edit
Delete
Add Host
Clone Host
Manage Permissions
Host cluster creator
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Project creator
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Yes (cannot be changed)
Project manager
Yes
Yes
Yes
Yes
Yes
Yes
Product manager
Yes
No
No
No
No
No
Test manager
Yes
No
No
No
Yes
No
O&M manager
Yes
No
No
No
Yes
No
System engineer
Yes
No
No
No
No
No
Committer
Yes
No
No
No
No
No
Developer
Yes
Yes
Yes
Yes
Yes
No
Tester
Yes
No
No
No
Yes
No
Participant
Yes
No
No
No
Yes
No
Viewer
Yes
No
No
No
Yes
No
- Edit hosts in the host cluster.
- Verifying host connectivity in batches: Select multiple hosts and click .
- Cloning a host to another host cluster in batches: Select multiple hosts and choose More > Clone to Another Host Cluster. Then select the target host.
- Editing a host: Click in the Operation column of a host to modify the configuration.
- Enabling network connectivity verification: Click in the Operation column of a host.
- Deleting a host: Click in the Operation column of a host, click Delete, and click OK.
- If you want to delete a host from an application, select Disassociate and Delete to remove the host information from the environment. Otherwise, the host cannot be deleted.
- A proxy host cannot be deleted directly. It is deleted only when its last target host is deleted from the environment.
- Cloning a host to another host cluster: Click in the Operation column of a host, click Clone, and select the target host cluster.
Obtaining the Linux Key
- Check whether the key exists on the host.
Log in to the host and run the following command to switch to user root:
sudo su root
Run the following command to view the key file:
ls ~/.ssh
- If a message is displayed indicating that the directory does not exist or the ~/.ssh directory does not contain the id_rsa file, go to Generate a key.
- If the id_rsa file exists in the ~/.ssh directory, you can use the existing key file or go to Generate a key to generate a new key file.
- Generate a key.
Perform the following steps:
- Generate a key.
ssh-keygen -t rsa
- When the following information is displayed, press Enter.
- When the following information is displayed, press Enter. By default, no password is set. (Setting the password will fail the key verification of CodeArts Deploy.)
- When the following information is displayed, press Enter.
- If the following information is displayed, the key has been generated:
- Run the following command: to view the key file generated in the .ssh directory. The id_rsa and id_rsa.pub files store the generated private key and public key, respectively.
ls ~/.ssh
- Generate a key.
- Check information about the key generated.
Run the following command:
cat ~/.ssh/id_rsa
- If the key prefix is -----BEGIN RSA PRIVATE KEY-----, the key is correct. Copy the key and save it to the local PC. Enter the key when adding a host or proxy.
- If the key prefix is -----BEGIN OPENSSH PRIVATE KEY-----, the key is incorrect. Run the following command to generate a new key:
ssh-keygen -m PEM -t rsa
- Authorize the key.
Run the following command to add the public key to the authorized_keys file of the host:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- To perform operations on the authorized_keys file, you must have the permission to operate the id_rsa and id_rsa.pub files.
- When the key is used for connectivity verification, the username must be the name of the user who operates the authorized_keys file.
- Do not copy unnecessary spaces when manually copying the key. Otherwise, the connectivity verification may fail.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.