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
The zero-node cluster is in the Inactive status after the creation and is 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.

Instructions

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


  • Create a Resource Access Management (RAM) user if you have activated the RAM service.
  • Create the ECS instances and distribute the Internet IP address 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.
  • If the VPC node configuration fails, Container Service collects the standard output of the node creation and initialization. You can view the information in the cluster logs.

Limits

  • 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. The cluster fails to be created if the quota is exceeded.  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.

Procedure

  1. Log on to the Container Service console.
  2. Click Swarm > Clusters in the left-side navigation pane. 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–63 characters long and contain numbers, Chinese characters, English letters, and hyphens  (-).
      Note
      The cluster name must be unique under the same account and the same region.
    • Region: Select the region in which the cluster is to 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 network type of the cluster.  Currently, Container Service only supports VPC.
    Complete the corresponding configurations.


    VPC enables you to build an isolated network environment based on Alibaba Cloud. You can have 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, a VSwitchId, and the initial CIDR block of containers (the subnet CIDR block to which the Docker containers belong. For ease of IP management, containers of different virtual machines belong to different CIDR blocks, and container subnet CIDR block cannot conflict with virtual machine CIDR block).  We recommend that you build your own VPC/VSwitchId for the cluster to prevent issues  such as network conflicts.

  5. Select whether or not to add nodes.


    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.4 64bit  are supported.

      2. Configure the ECS instance specifications.


        You can select the generation, family, type, and quantity of the instance, disk type and 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.

        Note
        • The data disk is mounted 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 that you mount an independent data disk to the host  and manage the persistent data of containers 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.

  6. Select whether or not to configure public EIP.

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

    Note
    You can apply for up to 20 EIPs per account. To use VPC and create EIP automatically when creating a cluster, the cluster fails to be created if the number of EIPs under your account reaches its quota.


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


    The Automatically Create Server Load Balancer check box is selected by default. With this check box selected, a 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. The created Server Load Balancer instance is in the Pay-As-You-Go mode.

  8. Select whether or not to install cloud monitoring plug-in on your ECS instances.
    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.


  9. You can select to add the IP addresses of the ECS instances to the RDS instance whitelist.

    Adding the IP addresses of the ECS instances to the RDS instance whitelist facilitates the ECS instances to access the RDS instances.

    Note
    • We recommend that you configure the RDS Whitelist when Add is selected for Add Node.
    • If Do not Add is selected for Add Node and you want to configure the RDS Whitelist, add the existing ECS instances on the Create Cluster page. The RDS Whitelist cannot be configured if you create a zero-node cluster and add existing ECS instances after the cluster creation.
    • 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.
    1. Click Select RDS Instances. The Add to RDS instance whitelist dialog box appears.


    2. Select the RDS instances and then click OK.


  10. Click Create Cluster.

    After the cluster is successfully created, you can configure the ECS instance or Server Load Balancer instance in 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.

References

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