Log on to the Container Service console.
Click Services in the left-side navigation pane.
Select the cluster in which the service you want to add a domain name resides from the Cluster list.
Click Update at the right of the service you want to add a domain name (the service web of the application wordpress in this example).
Click the plus icon next to Web Routing. Enter the domain name to be added (
www.51ili.comis added in this example), and click Update to update the configurations.
Note: To add multiple domain names under the same port for the same service, enter the domain names in one entry and separate them by semicolons (;).
Wait until the service finishes the update and changes to the Ready status. After that, the routing service
acsrouting_routingfinishes configuring the domain name. When requests containing the domain name
www.51ili.comare sent to access the service web, the requests can be correctly resolved and forwarded to the corresponding service.
Resolve the domain name to the Container Service cluster. When you create a cluster, Container Service assigns a Server Load Balancer instance to the cluster by default. The assigned Server Load Balancer instance only belongs to you.
- Click Clusters in the left-side navigation pane in the Container Service console.
Click Manage at the right of the cluster (test in this example).
Click Load Balancer Settings in the left-side navigation pane and view the Server Load Balancer ID.
Click Products > Server Load Balancer to go to the Server Load Balancer console.
View the IP address of the Server Load Balancer instance according to the instance ID.
Log on to the Alibaba Cloud DNS console and add a DNS record (
www.51ili.comin this example).
- Add a domain name. For more information, see Add and manage domain names. Skip this step if the domain name already exists.
Add a DNS record. For more information, see Add and manage records.
- Type: Select A - IPV4 address.
- Host: Enter www. This is the domain name prefix. You can also enter another prefix.
- ISP Line: Select Default.
- Value: Enter the IP address of the bound Server Load Balancer instance.
- TTL: Select the time.
Redeploy the application (wordpress in this example) in the Container Service console.
Click the application name (wordpress in this example) and then click the Routes tab. The DNS takes effect.