Set the root domain name of a cluster

Last Updated: Nov 28, 2017

When you create an Nginx webserver from an image and configure the web routing rules, you only need to enter the domain name prefix nginx. Then, you can obtain the domain name in the format of $cluster_id.$region_id.alicontainer.com. You can replace this domain name by setting a root domain name (51ili.com is used in this example) of the cluster. When you redeploy the application nginx, the domain name changes from nginx.cd5b226071936493b89e75bbe8841664c.cn-hangzhou.alicontainer.com to nginx.51ili.com, which makes it convenient for you to access the cluster applications with your own root domain name.

Note: To guarantee the normal operation of the following example, upgrade the Agent to the latest version first.

Procedure

  1. Bind a Server Load Balancer instance.

    1. Log on to the Container Service console.

    2. Click Clusters in the left-side navigation pane.

    3. Click Manage at the right of the cluster (routing-test-online in this example) that you want to configure.

      manage

    4. Click Load Balancer Settings in the left-side navigation pane.
      If no Server Load Balancer instance is bound to this cluster, log on to the Server Load Balancer console and create a Server Load Balancer instance. Then, return to this page and bind the instance to this cluster.

      Note: For more information about how to bind and unbind a Server Load Balancer instance to and from a cluster and the limits in Container Service, see Bind and unbind a Server Load Balancer instance.

      1

  2. Set the domain name.

    1. Click the Set Domain Name tab and enter the root domain name you bought in the Domain Name field. In this example, 51ili.com is entered.

      1

    2. Click Set.

  3. Resolve the domain name to the bound Server Load Balancer instance.

    1. Log on to the Server Load Balancer console. Click Instances in the left-side navigation pane, and then click the ID of the Server Load Balancer instance bound to the cluster routing-test-online.

    2. View the instance details. Find the instance IP address.

      1

    3. Log on to the Alibaba Cloud DNS console and add a DNS record.

      • Add a domain name first. For details, see Add and manage domain names. Skip this step if the domain name already exists.

      • Add a DNS record. For details, see Add and manage records. Enter the IP address of the Server Load Balancer instance bound to the cluster in the Value field.

        1

  4. Redeploy the nginx application.

    1. Click Redeploy at the right of nginx.

    2. The service access endpoint of the application nginx is changed.

      The access endpoint before setting the root domain name.

      1

      The access endpoint after setting the root domain name.

      1

    3. Access the latest access endpoint http://nginx.51ili.com.

      1

Thank you! We've received your feedback.