Get started with Edge Container

更新时间:
复制 MD 格式

Create an Edge Container, connect your containerized application to a domain name, and access it through that domain.

Important

Edge Container is currently in beta. During the beta period, the service is available free of charge to eligible users. To apply for access, please contact us.

Create a container

Edge Container involves five stages: creating an application, configuring triggers, creating a version, debugging, and releasing.

Step 1: Create an application

An application is the basic unit for managing Edge Containers. Bind an Edge Security Acceleration (ESA) domain name to an application to expose it as an external service.

  1. Log on to the ESA console, and in the navigation pane on the left, choose Edge Computing and AI > Edge Container.

  2. Click Create Application, enter information such as Application Name and Service Port, and then click OK.

    • Application Name: The name must start with a lowercase letter and can contain only lowercase letters, digits, and hyphens (-). The name must end with a lowercase letter or a digit and be 6 to 128 bytes in length.

    • Service Port: The port that the service in the container exposes. The valid port range is 1 to 65535.

    image

Step 2: Create a trigger

A trigger defines how an Edge Container exposes services. By binding a domain, you connect a containerized application to your own domain name. ESA automatically adds a DNS record for the bound domain, and you can then use that domain to access the containerized application.

  1. In the list of edge containers, click the target application ID or View Details in the Actions column.

  2. On the Triggers tab, click Add Domain Name.

  3. Enter the Domains to access the container, and click OK.

    image

  4. After you add the domain, a new DNS record is created for your site. You can then use this domain name to access your containerized application.

Step 3: Create a version

A version is required before you can release an application. Each version can have its own container image, computing specification, and health check method.

Note

You cannot release a new version until the traffic percentage for the current release reaches 100%. However, you can roll back at any time.

  1. In the Edge Container list, click the application ID or View Details in the Actions column.

  2. On the Version Management tab, click Create Version.

  3. Enter the Version Name, Remarks, and Image Settings, and then click OK to create the version.

    Parameter

    Parameter

    Description

    Version Information

    Version Name

    The version name must be 6 to 128 characters long and can contain only lowercase letters, numbers, and hyphens (-). It must start with a letter and end with a letter or a number. The name must be unique.

    Description

    A description of the version.

    Image Settings

    Image Name

    The name must be 6 to 128 characters in length and can contain only lowercase letters, digits, and hyphens -. It must start with a letter and end with a letter or a digit. The image name must be unique.

    Image Type

    Custom Image: Enter the full address of your custom container image.

    ACR image:

    • To use an ACR image, you must first activate Container Registry. Then, build repositories and images in Container Registry. ESA can directly reference images from Container Registry after you grant ESA permission to pull them.

    • Artifact Center: A feature of Alibaba Cloud Container Registry (ACR) that provides secure and trusted official base container images from Alibaba Cloud and the OpenAnolis community. These images include base operating systems, language runtimes, and images for AI and big data applications. They support multiple architectures, making the containerization process more efficient and secure.

    Container Settings

    Computing specification

    Select the CPU and memory resources for your application. Supported specifications include 1C2G, 2C4G, 2C8G, 4C8G, 4C16G, 8C16G, and 8C32G. Fees vary based on the selected specification.

    Temporary Disk Capacity

    Supported sizes are 512 MB, 10 GB, 20 GB, and 30 GB. The 512 MB option is free of charge, while other sizes are billed.

    Startup Command

    The command that runs after the container is created to start the service process.

    Health check method

    The health check method. Supported methods: HTTP, TCP, and COMMAND.

    • HTTP

      • Health Check URL: The health check path, for example, /test.

      • Probe Port: The port to probe. Valid values: 1 to 65535.

      • Probe Host: The Host header for the HTTP health check request.

      • SCHEME: The protocol to use. Supported values: HTTP and HTTPS.

      • HEADER: Custom HTTP headers for the health check request.

    • TCP

      • Probe Port: The port to probe. Valid values: 1 to 65535.

    • COMMAND

      • A custom script. The health check is considered successful if the script returns an exit code of 0. Any other exit code indicates a failure.

    Health Check Parameters

    Initial probe delay

    The time in seconds to wait after a container starts before the first health check begins. Useful for applications with long startup times.

    Timeout

    • For HTTP health checks, this is the response timeout.

    • For TCP health checks, this is the connection handshake timeout.

    • For COMMAND health checks, this is the script execution timeout.

    Probe Interval

    The time interval in seconds between two consecutive health checks.

    Success Threshold

    The number of consecutive successful health checks required after a failure to mark the container as healthy. Once this threshold is met, the container is returned to service.

    Failure Threshold

    The number of consecutive failed health checks required to mark the container as unhealthy. Once this threshold is met, the container is removed from service.

    Advanced Commands

    postStart

    Runs after a container is created but before the startup command is executed, typically for system initialization.

    preStop

    Runs before a container is terminated, typically for a graceful shutdown.

    Environment Variable

    Key

    The name of the environment variable.

    Value

    The value of the environment variable.

Step 4: Debug

Before you publish to the Production Environment, debug your application in the provided staging environment. The staging environment and the production environment are isolated, and you can publish different application versions to each.

  1. In the Edge Container list, click the application ID or View Details in the Actions column.

  2. On the Version Management tab, click Release in the Staging Environment section. In the dialog box that appears, select the version to publish, and then click Release.

    Note

    When the release status is displayed as Released., the release to the staging environment is complete.

  3. After the release is successful, in the Staging Environment area, click Instance Logon to enter the container, and then debug the application in the command window.

  4. In the Staging Environment section, click Instance Logs to view the application's startup and runtime logs.

    image

Step 5: Release the version

Edge Container supports canary releases, allowing you to direct a percentage of traffic to a new version during a release.

  1. In the Edge Container list, click the application ID or View Details in the Actions column to go to the Versions tab.

  2. In the Production Environment area, click Release, and in the dialog box that appears, select the version to publish and the desired release ratio.

    image

  3. Click Release to start the release. A Release Status of Released. indicates that the release is complete.

    Note

    Edge Container supports canary releases. When the release percentage reaches 100%, the deployment is complete, and the new version becomes the baseline version.

    If an upgraded version does not meet your requirements, you can roll back to the previous baseline version. A rollback is complete when the release status shows Rolled Back. The version you rolled back to becomes the new baseline version.