Deploy an application from a non-ACR repository

更新时间:
复制 MD 格式

You can deploy SAE applications by using images from third-party repositories such as Docker Hub or Docker Registry. Ensure network connectivity between your application and the repository, configure access credentials, and specify the image address.

Prerequisites

Ensure network connectivity to the image repository

  • If the image repository is in the same VPC as your SAE application, no additional network configuration is required.

  • If the image repository is not in the VPC of your SAE application, you must establish a cross-VPC connection or enable a NAT Gateway for the application's VPC. If the image repository has access restrictions, you must also add the CIDR block of the application's VPC or the Elastic IP Address (EIP) bound to the NAT Gateway to the repository's allowlist.

How to view the VPC of an SAE application

Before you deploy an application, you must plan its region and namespace. This determines the VPC where the application is located.

  1. Log on to the SAE console, select a region in the top navigation bar, and select Namespaces in the left-side navigation pane.

  2. Click the target namespace in the list. In the left-side navigation pane, select Basic Information. Click the link in the VPC field to view details such as the VPC ID.

What if my SAE application is in a Chinese mainland region and cannot access an overseas image repository like Docker Hub?

Option 1: Domestic repository

Image repositories in the Chinese mainland, such as the ACR Artifact Center, may already host the image you need. For example, the address for an Nginx image is registry.openanolis.cn/openanolis/nginx:1.14.1-8.6.

Option 2: Overseas image via ACR

Pull the overseas image to your local machine, push it to ACR, and then deploy the application using an image from an ACR instance that belongs to the same account or an ACR instance that belongs to a different account.

Configure repository credentials

Create a secret to store the username and password for the image repository. On the Namespaces page, select the target region and click the target namespace. In the left-side navigation pane, choose Secrets, and then click Create.

  • For Type, select Image Repository Credentials.

  • Enter the IP address or domain name of the image repository.

  • Enter the Username and Password required to log on to the image repository.

Procedure

  1. On the SAE Application List page, select the target region and namespace in the top navigation bar, and then click Create Application.

  2. Select an application edition.

    Important

    The Lightweight Edition and Professional Edition are currently in an invite-only beta phase. For users not participating in the beta test, applications are created as the Standard Edition by default.

    • Lightweight Edition: Provides the minimum feature set required to run an application. It does not support the Application Monitoring and Microservices Governance features.

    • Standard Edition: Includes the Basic Application Monitoring feature. The Advanced Application Monitoring and Microservices Governance features must be enabled and purchased separately.

    • Professional Edition: Includes the Advanced Application Monitoring and Microservices Governance features, which do not need to be enabled or purchased separately.

  3. On the Create Application page, specify a custom Application Name and configure the following parameters.

    1. Select the namespace type for the application. A namespace is equivalent to a Kubernetes namespace and can be used to isolate resources in different environments. You cannot change the namespace of an application after it is created. Plan accordingly.

      • System Created: Use the default namespace, vSwitch, and security group created by the system in the current region.

      • Existing Namespace: Select a namespace, vSwitch, and security group that you created in advance.

    2. Set Application Deployment Method to Select Image Deployment, and then click Specify Image on the right. On the Custom Image tab, configure the following settings.

      • Select Public Network or Private Network to access the image repository based on your network configuration.

      • If the image repository requires a username and password, select the Secret for Username and Password of Image Repository that you created earlier.

      • Enter the full Image address in the format <Image repository public or private address>:<Image Tag>, for example, nginx:1.23.1.

    3. In the Capacity Settings section, set Resource Type, Single Instance Type, and Instances.

      Resource type

      Resource Type can be Default or Hygon. Hygon is currently in an invite-only beta phase. If you are not part of the beta test, Resource Type is automatically set to Default, and no manual selection is required.

      To deploy an application by using Hygon resources, contact technical support in the DingTalk group (group ID: 32874633) to enable the feature. You must also select a region and zone that support Hygon resources:

      • China (Shanghai): Supports zone B, zone G, and zone L.

      • China (Beijing): Supports zone H and zone I.

      • China (Hangzhou): Supports zone J.

  4. (Optional) Click Next: Advanced Settings to configure desired features.

    • Startup command

      The startup command for an application is determined by the CMD or ENTRYPOINT set in the image. No additional configuration is required in SAE. If you have specific requirements, you can set a startup command to override the one set in the image.

    • Runtime environment and lifecycle management

    • Network access and service invocation

    • Data persistence

      Store application data in NAS, OSS, or a database to prevent data loss when an application is changed or stopped. Note: NAS, OSS, and databases incur additional charges.

    • Logging and monitoring

      • After you deploy an application, you can view real-time logs and view resource usage and load without additional configuration. You can also output logs to SLS or Kafka for centralized management and analysis. Note: SLS and Kafka incur additional charges.

      • ARMS helps you track application health, quickly find failed and slow APIs, identify performance bottlenecks, and reproduce call parameters, which improves production troubleshooting efficiency.

        • For Standard Edition applications, you can view ARMS Basic Edition monitoring data after deployment without additional configuration. You can also enable and purchase ARMS Premium Edition monitoring.

        • For Professional Edition applications, after you enable Application Monitoring in Advanced Settings and deploy the application, you can view ARMS Premium Edition monitoring data. No additional fees are required.

    • Other features

      • Microservices Governance provides Graceful Start and Shutdown, traffic protection, end-to-end canary release, and Intra-zone Provider First for Java applications.

        • For Standard Edition applications, go to the application details page after deployment to enable and purchase the MSE Microservices Governance feature.

        • For Professional Edition applications, after you enable Microservices Governance in Advanced Settings, you can configure Graceful Start and Shutdown. For more features, go to the application details page after deployment. No additional fees are required.

      • You can enable the CPU Burst feature to avoid wasting resources when CPU requirements are higher at startup than during normal operation.

      • You can decouple and standardize non-business features from the main container by adding a sidecar container.

      • You can enable RRSA identity authentication to implement instance-level API permission control and avoid the key leakage risks associated with traditional authentication methods.

  5. Click Create Application with One Click or Create Application.

    • Creating the application takes about 1 to 2 minutes. You can view change records to verify that the deployment was successful. If the deployment fails, no application instance is created. You can troubleshoot the issue based on the error message in Change Details.

    • You can view the created application on the page. To change the application configuration after deployment, click the target application to go to its details page. Then, click Deploy Application or Modify Application Configurations at the top. The application automatically restarts to apply the new configuration. Perform this operation during off-peak hours.

    • You can log on to an application instance by using Webshell and interact with the instance by using console commands.

    • After you create an application, you can manually adjust the number of instances and the instance specification, or automatically adjust the number of instances by configuring an auto scaling policy. You can also reduce costs by enabling idle mode.