After you deploy an application on Serverless App Engine (SAE), you can bind an Internet-facing Server Load Balancer (SLB) instance to the application to enable Internet access. You can also bind an internal-facing SLB instance to the application to enable communication with the other applications in the virtual private cloud (VPC) in which your application resides. This topic describes how to bind an SLB instance to an application and manage the SLB instance.
Prerequisites
The following section describes the prerequisites of different scenarios in which an SLB instance is bound to an application:
Scenario 1: Bind an existing SLB instance
An existing SSL certificate is uploaded. For more information, see Uploaded certificates.
An application is deployed on SAE. For more information, see Deploy an application in the SAE console.
ImportantOnly existing SLB instances that meet the following conditions can be used in SAE:
The instance is not a shared-resource SLB instance.
The instance is not an SLB instance that is exclusive to Container Service for Kubernetes (ACK).
The instance is purchased in the SLB console. To prevent the conflicts in listener configurations, SAE does not use existing SLB instances that are purchased or exclusively used by other cloud services.
The instance resides in the same VPC as the instances of the application that you deployed on SAE.
Scenario 2: Bind a new SLB instance
An existing SSL certificate is uploaded. For more information, see Uploaded certificates.
An SLB instance is created. For more information, see Create an SLB instance.
An application is deployed on SAE. For more information, see Deploy an application in the SAE console.
Background information
You can bind Classic Load Balancer (CLB) instances to SAE applications. CLB instances belong to the Server Load Balancer (SLB) family. Before you bind an SLB instance to an application, read the following topics:
Limits
The number of instances in the application to which you want to bind an SLB instance must be greater than 0. If the number of instances is 0, you cannot bind an SLB instance to the application as expected. Before you bind an SLB instance, you must scale out the application. For more information, see Manually scale instances.
The application to which you want to bind an SLB instance must be in the Running state. If the application is stopped, you must start the application before you bind an SLB instance to the application. For more information, see Manage the lifecycle of an application.
Scenario 1: Bind an existing SLB instance
Log on to the SAE console.
In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.
On the Basic Information tab of the Basic Information page, bind an SLB instance on the SLB-based Access tab in the Application Access Settings section.
To bind an internal-facing SLB instance, click Add Internal-facing SLB Instance.
To bind an Internet-facing SLB instance, click Add Internet-facing SLB Instance.
In this example, Add Internet-facing SLB Instance is clicked.
Click Add Internet-facing SLB Instance.
In the Add Internet-facing SLB Instance dialog box, select an existing SLB instance from the Select SLB Instance drop-down list.
Select a protocol type and specify listening ports for the SLB instance.
Parameter
Description
HTTP
HTTP Port: the port of the SLB instance. The port is used to access the application over the Internet. Valid values: 1 to 65535.
Container Port: the port to which the process listens. The port is defined by the application. For example, a web application uses port 8080 by default.
HTTPS
HTTPS Port: the port of the SLB instance. The port is used to access the application over the Internet. Valid values: 1 to 65535.
SSL Certificate: the SSL certificate. You can select an existing SSL certificate from the drop-down list.
Container Port: the port to which the process listens. The port is defined by the application. For example, a web application uses port 8080 by default.
TCP
SLB Port: the port of the SLB instance. The port is used to access the application over the Internet. Valid values: 1 to 65535.
Container Port: the port to which the process listens. The port is defined by the application. For example, a web application uses port 8080 by default.
UDP
SLB Port: the port of the SLB instance. The port is used to access the application over the Internet. Valid values: 1 to 65535.
Container Port: the port to which the process listens. The port is defined by the application. For example, a web application uses port 8080 by default.
Click OK.
Verify the result.
Copy the IP address and port of the bound SLB instance. Example:
192.168.0.184:80
. Enter the URL in the address bar of your browser and then press Enter to view the homepage of the application.If no IP address or port number is displayed in the Public Endpoint field, the Internet-facing SLB instance failed to be bound. In this case, you must check the change records and fix the failure. For more information, see View change records.
Scenario 2: Bind a new SLB instance
For information about how to use SAE to purchase an SLB instance and bind the SLB instance to your application, see the corresponding step in the Bind an existing SLB instance section. When you select an SLB instance in Step3, select Create from the Select SLB Instance drop-down list.
If you select Create, SAE automatically checks the SLB quota and your account balance. If the check is passed, SAE purchases an SLB instance for the application. The information about the SLB instance is displayed in the lower part of the dialog box.
Related operations
If you delete all instances of an application, SAE stops the billing of the application. The fees that are generated by using SLB instances are not included into your SAE bills. For example, if you unbind an SLB instance from an application or modify the bound SLB instance in SAE, the SLB instance is still running. In this case, you are still charged for using the SLB instance. If you no longer need to use the SLB instance, the billing is stopped only if the SLB instance is released. For more information, see Release a CLB instance.
Modify the SLB access configuration
On the Basic Information tab of the Basic Information page, click Edit Internal-facing SLB Instance or Edit Internet-facing SLB Instance on the SLB-based Access tab in the Application Access Settings section based on your network requirements.
In the Edit Internal-facing SLB Instance or Edit Internet-facing SLB Instance dialog box, modify the parameters and click OK.
Delete the SLB access configuration
On the Basic Information tab of the Basic Information page, click Delete Internal-facing SLB Instance or Delete Internet-facing SLB Instance on the SLB-based Access tab in the Application Access Settings section.
In the Delete Internal-facing SLB Instance or Delete Internet-facing SLB Instance message, click OK.
Enable low-traffic service prefetching (invitational preview)
On the Basic Information tab of the Basic Information page, click Enable Low-traffic Service Prefetching on the SLB-based Access tab in the Application Access Settings section.
In the Low-traffic Service Prefetching dialog box, configure the Initial Traffic Weight and Total Prefetching Period parameters and click OK.