It takes two steps to create a Swarm cluster for applications:
You can remove ECS instances from the cluster as needed.
Create a cluster
Log on to the EDAS console.
In the left-side navigation pane, select Resources > Clusters to go to the Clusters page.
In the upper-right corner, click Create Cluster and then set the fields in the Create Cluster dialog box.
Cluster field descriptions:
- Cluster Name: Up to 64 characters are allowed and can contain alphabetical letters, digital numbers, underscores, and periods.
- Cluster type: Select ECS.
- Network type: Classic network or VPC. Select the network type as needed. If you select VPC, you must select the specific VPC from the VPC Network drop-down menu.
- VPC Network: Select a VPC from the drop-down menu.
- Namespace: The namespace where the cluster is located. Region is displayed if no namespace is specified. Cannot be selected.
After setting the fields, click Create to create the cluster.
After the cluster is created, it is displayed in the cluster list.
Note: The created cluster is empty. You must Add Cluster Host so that applications can use the cluster.
Add a cluster host
Adding a Swarm cluster host may involve converting a Docker host. The Docker host conversion uses a Docker image to reinstall the operating system of the ECS instance on which the Docker host runs. For more information, see Docker image deployment.
On the cluster details page, click Add Cluster Host in the upper-right corner.
In the Select Cluster and ECS page, select the ECS instance and then click Next.
- Import ECS: Namespace and Cluster cannot be configured if you select this option. You can only import ECS instances in the specified namespace and cluster.
- From Existing Cluster: Select the namespace and cluster, and then choose the ECS instances to be imported.
If no instances are available, click Create ECS Instance in the upper-right corner of the page. This takes you to the ECS purchase page on the Alibaba Cloud official website, where you can purchase and create a new ECS instance. For more information, see the Create an instance.
On the Set New Password page, enter and confirm a new logon password for this Docker host. Then, click Next.
- An EDAS Docker image will be used to reinstall the operating system on the ECS instance. All data in the ECS instance is erased during the reinstallation. Make sure you still want to perform the conversion.
- The reinstallation requires you to reset the password. After installing the image, use the new password to log on to the ECS instance. This password is only used to install images and is not stored in EDAS.
In the dialog box that appears, confirm that you would like to convert the ECS instance and click Import.
After the conversion starts, the Docker host status is shown in the cluster deployment information list.
- When the conversion starts, the Docker host status is Converting. The entire conversion process takes about five minutes. You can perform other operations in the EDAS Console during this period.
- There are two possible conversion results: Conversion Failed and Online.
- The Offline status indicates that EDAS cannot detect the Docker host’s heartbeat.
After the conversion, go back to the cluster details page and check the conversion result in the cluster deployment information area.
- If the conversion was successful, the health check shows Online. The node resources are ready for application deployment.
- If the conversion failed as the result of an exception, the host node is in the Conversion Failed status. In this case, identify and troubleshoot the cause of the failure and then click Retry next to the host node.
Remove a cluster host
Go to the cluster details page and find the host to remove in the list in the cluster deployment information area. Then, click Remove in the Actions field.
In the dialog box that appears, confirm the information of the host to be removed and then click Remove.
Note: Docker conversion is skipped if you re-add a Docker host that was previously removed from a cluster.