Serverless App Engine (SAE) allows you to deploy applications by using images, such as images that belong to your Alibaba Cloud accounts, private images that belong to other Alibaba Cloud accounts, demo images, and public images that can be accessed over the Internet. This topic describes how to use an image to deploy an application in a language other than Java, PHP, and Python in the SAE console.
Prerequisites
A virtual private cloud (VPC) is created. For more information, see Create a VPC.
A namespace is created. For more information, see Create a namespace.
An image is created for the application.
(Optional) Configure image synchronization in the Container Registry console
If the Alibaba Cloud image repository that you want to use does not reside in the same region as your application, you must use the image replication feature of Container Registry to replicate the image repository to the region where the application resides before you deploy the application.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
In the left-side navigation pane of the management page of the Enterprise Edition instance, choose .
On the Repositories page, click the name of the repository in which the images to be replicated reside.
In the left-side navigation pane of the details page of the image repository, click Tags. On the page that appears, find the image that you want to replicate and click Replicate in the Actions column that corresponds to the image.
In the Image Replication dialog box, set Replication Scenario to Same Account, select the region where the destination instance resides and select the name and namespace of the destination instance. Enter the name of the destination repository and the image tag, specify whether to overwrite the existing image that has the same name as the pushed image, and then click OK.
In the left-side navigation pane of the management page of the Container Registry Enterprise Edition instance, choose
. On the Replication Record page, the status of the replication task is displayed as Completed. If the manual replication is successful, the image appears in the destination instance.After the image replication is completed, the image repository that you selected in the Container Registry console is synchronized to the specified destination repository. Then, you can select the image in the Deployment Configurations step when you deploy an application in the SAE console.
Deploy an application
Log on to the SAE console.
In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click Create Application.
In the Basic Information step, configure the parameters and click Next: Application Deployment Configurations.
Parameter
Description
Application Name
Enter a custom application name.
VPC
Select a configuration method for the VPC. Valid values:
Custom Configuration: If you select this option, you must manually specify the namespace, VPC, vSwitch, and security group for the application that you want to create.
Automatic Configuration: If you select this option, SAE automatically specifies the namespace, VPC, vSwitch, and security group for the application.
Namespace
This parameter is required if you set the VPC parameter to Custom Configuration.
Select an existing namespace from the drop-down list. Namespaces and VPCs are in one-to-one mapping relationships. For information about how to modify a VPC, see Create and manage a VPC.
vSwitch
This parameter is required if you set the VPC parameter to Custom Configuration.
Click Select vSwitch. In the Select vSwitch dialog box, select the required vSwitches.
You must specify at least one vSwitch. We recommend that you specify no more than three vSwitches. Each vSwitch must match at least one application instance.
Security Group
This parameter is required if you set the VPC parameter to Custom Configuration.
Select a security group from the drop-down list. If you have not created a security group in your VPC, click Create Security Group to create a security group as prompted. For more information, see Create a security group.
Application Instances
Select the number of instances that you want to create.
VCPU
Select a CPU specification for the instances that you want to create.
Memory
Select a memory specification for the instances that you want to create.
Application Description
Enter a description for the application.
In the Deployment Configurations step, configure the parameters.
Configure the parameters that are used to deploy an application.
Parameter
Description
Technology Stack Programming Language
Select Other (such as C++, Go, .NET, and Node.js).
Application Deployment Method
Only the Image option is available.
Configure Image
Select the type of image that you want to use.
Images of Current Alibaba Cloud Account: Select an image that is uploaded to Container Registry within your Alibaba Cloud account and the version of the image.
Container Registry Personal Edition: Configure the Image Repository Namespace and the Image Repository Name parameters to filter images.
Container Registry Enterprise Edition: Select a Container Registry Enterprise Edition instance from the drop-down list.
NoteIf you select Container Registry Enterprise Edition, you must first create a Container Registry Enterprise Edition instance in the Container Registry console and associate the instance with a virtual private cloud (VPC) and a vSwitch. For more information, see Create a Container Registry Enterprise Edition instance and Configure a VPC ACL.
If you do not associate the VPC and vSwitch of an SAE application with a Container Registry instance in the Container Registry console, you cannot use an image in the instance to deploy the application in the SAE console.
If the Alibaba Cloud image repository that you want to use does not reside in the same region as your application, you must use the image synchronization feature of Container Registry to synchronize the image repository to the region where your application resides. For more information, see (Optional) Configure image synchronization in the Container Registry console.
Demo Image: Select a version of a demo image from the drop-down list.
Public Image: Enter the full URL of a public image that can be accessed over the Internet. Make sure that the VPC can be accessed over the Internet.
Private Images of Other Alibaba Cloud Account: Configure the Container Registry Edition and Image Type parameters. Then, configure the related parameters.
NoteFor information about how to obtain the Alibaba Cloud Resource Name (ARN) of the RAM role (acrAssumeRoleArn) that is required to pull images across Alibaba Cloud accounts in the Resource Access Management (RAM) console, see Pull Alibaba Cloud images across accounts.
If you select Container Registry Enterprise Edition, you must configure the following parameters for each application: Enterprise Edition Instance ID, acrAssumeRoleArn, and Complete Image Repository Address.
If you set the Image Type parameter to Static Username and Password, you must first create a secret. For more information, see Manage a Kubernetes Secret.
Optional:Configure the advanced settings based on your business requirements.
Advanced setting
References
Startup Command Settings
Environment Variable Settings
Application Monitoring
Service Registration and Discovery
Hosts Binding Settings
Application Health Check
Application Lifecycle Management
Application Outbound/Inbound Internet Access
Log Collection Service
Persistent Storage
Configuration Management
Click Next: Confirm Specifications.
In the Specification Confirmation step, view the details of the application and the fee for the selected specifications. Then, click Confirm.
The Creation Completed step appears. You can click Application Details to go to the Basic Information page of the application.
Verify the deployment result
After an application is deployed, you can use one of the following methods to verify the deployment result for the application.
View the running status of application instances.
Log on to the SAE console.
In the left-side navigation pane, click Applications. On the Applications page, click the name of the application that you want to manage.
On the Basic Information page, click the Instance Deployment Information tab to view the running status of the instances.
If Running or Completed is displayed in the Status column, the application is deployed.
Add an Internet-facing Classic Load Balancer (CLB) instance to the application.
After an application is deployed, you can configure a CLB instance to allow access to the application within a specified period of time for other applications.
CLB instances are classified into the following types:
Internal-facing CLB instance: provides an access portal in the VPC where the application resides to ensure that the application can be accessed by other applications in the same VPC.
Internet-facing CLB instance: SAE can automatically purchase an Internet-facing CLB instance for an application, or you can use an Internet-facing SLB instance that you purchased in the CLB console. This helps ensure that the application can be accessed by other applications over the Internet.
NoteYou can allow access to an application by using an Internet-facing CLB instance the same way you allow access to an application by using an internal-facing CLB instance. For more information, see Bind a CLB instance to an application. After a CLB instance is bound to an application, you can enter a URL that consists of the IP address, port, and access path of the CLB instance in the address bar of your browser to access the application. Example: 192.168.XX.XX:80/image.
View application metrics
After an application is deployed, you can view the key performance metrics of the application in the Application Monitoring module.
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 the application that you want to manage.
In the left-side navigation pane, view application monitoring data based on your business requirements.
Application Overview: Choose
. The Application Overview page displays the key performance metrics of the application, such as the total number of requests and the average response time.Application Details: Choose
. The Application Details page displays more comprehensive application monitoring data, such as the data for JVM monitoring and exception analysis.API Operation Calls: Choose
. The API Operation Calls page displays the monitoring data by API operation, such as the call topology, upstream and downstream links.Advanced Monitoring: Choose
. The Advanced Monitoring page displays higher-performance monitoring and management data, such as global application topology, data of SQL exception analysis, and local call stack.
References
The following table describes the operations that you can perform on an application after you deploy the application on SAE.
Operation | References |
Lifecycle management operations, such as updating, starting, stopping, and deleting an application, and scaling in or scaling out the instances for an application | |
Performance optimization operations, such as configuring auto scaling policies for an application, binding Server Load Balancer (SLB) instances to an application, and starting or stopping applications in batches | |
Application status-based operations, such as managing logs, configuring monitoring settings, viewing application events, and viewing change records |