All Products
Document Center

Create a cluster

Last Updated: Jan 16, 2018

Alibaba Cloud Container Service supports creating swarm mode clusters. You can specify the configurations and the number of Elastic Compute Service (ECS) instances when creating clusters. You can also create a zero-node cluster, and then bind it with other ECS instances.

Note: Currently, swarm mode clusters are in public beta.

The zero-node cluster is in the Inactive status after the creation and will be activated with the Running status after you add ECS instances to it. For how to add existing ECS instances to the cluster, see Add an existing ECS instance.


Container Service performs the following operations when creating a cluster:

  • Create a Server Load Balancer instance with 80:9080 configured as the listener if the Automatically Create Server Load Balancer check box is selected.

  • Create a security group. The security group rules are as follows:
    Virtual Private Cloud (VPC) inbound:


    Classic network (Internet inbound and intranet inbound):



  • Create a Resource Access Management (RAM) sub-account if you have activated the RAM service.

  • Create the ECS instances and distribute the public IP to the ECS instances if you select Add in the Add Node field. (If the Network Type is VPC, distribute the Elastic IP (EIP) to the ECS instances and create the corresponding routing rules.)

  • Use the configured Logon Password to configure the ECS instances.

    Note: Container Service does not save this password.


  • Server Load Balancer instances created with clusters are only available in Pay-As-You-Go mode.
  • By default, each account has a certain quota for the cloud resources they can create. If the quota is exceeded, the cluster will fail to be created. Make sure you have enough quota before creating the cluster. To increase your quota, open a ticket.
    • By default, each account can create at most five clusters in all regions and add up to 20 nodes to each cluster.
    • By default, each account can create at most 100 security groups.
    • By default, each account can create at most 60 Pay-As-You-Go Server Load Balancer instances.
    • By default, each account can create at most 20 EIPs.


  1. Log on to the Container Service console.

  2. Click Clusters in the left-side navigation pane, and then click Create Cluster in the upper-right corner.


  3. Complete the following configurations.


    • Cluster Name: Enter the name of the cluster. It can be 1–64 characters long and contain numbers, Chinese characters, English letters, and hyphens (-).

      Note: The cluster name must be unique under the same user and the same region.

    • Region: Select the region in which the cluster will be deployed.
    • Zone: Select the zone for the cluster.

      Note: You can select the region and zone according to the distribution of your servers.

  4. Select the Swarm Mode (Beta) check box in the Cluster Mode field.

  5. Select Classic or VPC as the network type for the cluster. The corresponding ECS instances and other cloud resources are managed under the corresponding network environment.

    • If you select Classic, no additional configurations are required.

      Classic network, a way of saying relative to VPC, is a public basic network uniformly planned by Alibaba Cloud. The network address and topology are assigned by Alibaba Cloud and can be used without special configurations.

    • If you select VPC, complete the configurations in the following figure:


      VPC enables you to build an isolated network environment based on Alibaba Cloud. You can have a full control over your own virtual network, including a free IP address range, Classless Inter-Domain Routing (CIDR) block division, and the configurations of route table and gateway.

      Specify a VPC and a VSwitchId. We recommend that you build your own VPC/VSwitchId for the container cluster to prevent issues such as network conflicts.

  6. Select whether to add nodes or not.


    You can create a cluster with several new ECS instances, or create a zero-node cluster and then add existing ECS instances to the cluster. For how to add existing ECS instances to the cluster, see Add an existing ECS instance.

    • Add

      1. Select the operating system for the node.


        Currently Ubuntu 14.04/16.04 64bit and CentOS 7.0 64bit are supported.

      2. Configure the ECS instance specifications.


        You can configure different instance types and quantities, data disk capacity (the ECS instance has a 20 GB system disk by default), and logon password. Container Service uses the configured Logon Password to configure the ECS instances when creating the cluster, but does not save this password.


        • The data disk is attached to the /var/lib/docker directory and used for the storage of Docker images and containers if you select the Attach Data Disk check box.
        • In terms of performance and management, we recommend attaching an independent data disk to the host and managing the persistent data in the container by using Docker volumes.
    • Do not Add

      You can click Add Existing Instance to add existing ECS instances to the cluster, or click Add Existing Instances on the Cluster List page to add existing ECS instances to the cluster after the cluster is created. For more information, see Add an existing ECS instance.


  7. Select whether to configure public EIP or not.

    If you select VPC as the network type, Container Service configures an EIP for each ECS instance under the VPC by default. If this is not required, select the Do not Configure Public EIP check box and then configure the SNAT gateway.


  8. Select whether to create a Server Load Balancer instance or not.


    The Automatically Create Server Load Balancer check box is selected by default. With this check box selected, a public network Server Load Balancer instance is created after the cluster is created. You can access the container applications in the cluster by means of this Server Load Balancer instance.

    Note: This is a Pay-As-You-Go Server Load Balancer instance.

  9. Select whether to install cloud monitoring plug-in on your ECS instances or not.

    To view the monitoring information of the created ECS instances in the CloudMonitor console, select the Install cloud monitoring plug-in on your ECS check box.


  10. You can select to add the IP addresses of the ECS instances to the RDS instance whitelist, which facilitates the ECS instance to access the RDS instance.


    1. Click Select RDS Instances. The Add to RDS instance whitelist dialog box appears.

    2. Select the RDS instances and then click OK.


    • Configure the RDS Whitelist only when Add is selected for Add Node.
    • The ECS instance must be in the same region as the RDS instance so that the IP address of the ECS instance can be added to the RDS instance whitelist.
  11. Click Create Cluster at the upper right of the page.

  12. The Confirm Cluster Configuration dialog box appears. Check your configurations. Click OK to create the cluster or click Cancel to go back to the Create Cluster page and modify the configurations.

    After the cluster is successfully created, you can configure the ECS or Server Load Balancer instance on the corresponding console.

Subsequent operations

On the Cluster List page, you can click View Logs at the right of the cluster to view the creation process logs of the cluster.


You can create applications in the created cluster. For more information, see Create an application with an image.


If the cluster fails to be created, see Common errors leading to cluster creation failure for troubleshooting.