If you do not use an annotation to specify an existing Server Load Balancer (SLB) instance when you create an Ingress, the system automatically creates an Internet-facing SLB instance. This topic describes how to use the automatically created SLB instance with an Ingress to set up forwarding.
Prerequisites
- A serverless Kubernetes (ASK) cluster is created. You must configure a network address translation (NAT) gateway for the virtual private cloud (VPC) where the cluster is created so that the cluster can download container images from the Internet. For more information, see Create an ASK cluster.
- The kubectl client is connected to the ASK cluster. For more information, see Use kubectl to connect to an ASK cluster.
Procedure
Step 1: Deploy applications
Step 2: Configure an Ingress
Step 3: Access the applications
Note You must resolve the domain name to the IP address of the SLB instance.
In this example, the following DNS rule is added for the domain name to enable access
to the applications. We recommend that you apply for an Internet Content Provider
(ICP) number for the domain name if the domain name is used in the production environment.
139.168.XX.XX foo.bar.com
Access the coffee application.
- Access the coffee application by using a browser.
- Access the coffee application by using the command line tool.
curl -H "Host: foo.bar.com" http://139.168.XX.XX/coffee
Access the tea application.
- Access the tea application by using a browser.
- Access the tea application by using the command line tool.
curl -H "Host: foo.bar.com" http://139.168.XX.XX/tea