Help Center/ Cloud Application Engine/ Best Practices/ Using ELB to Build a Unified Public Network Access Entry for CAE Applications
Updated on 2025-07-15 GMT+08:00

Using ELB to Build a Unified Public Network Access Entry for CAE Applications

Context

During enterprises' digital transformation, containerized applications deployed by CAE usually run in Virtual Private Cloud (VPC). Due to the network isolation mechanism, private IP addresses cannot be directly accessed by public network users.

Elastic Load Balance (ELB) distributes public network traffic to multiple CAE components based on rules. It is the core solution for public network access of services in a VPC.

Solution

This solution uses ELB as the core and performs multi-step collaborative configuration to build a unified public network access entry for CAE applications.

This section describes this solution.

  1. Step 1: Use CAE to Create an Environment and Application and View Network Information

    In CAE, create an environment and application and record network information.

  2. Step 2: Use CAE to Create a Nginx Component

    In CAE, create a Nginx component by deploying an image.

  3. Step 3: Use ELB to Create a Dedicated Load Balancer

    In ELB, create a dedicated load balancer and bind an EIP to it. The load balancer must be in the same VPC and subnet as the CAE environment.

  4. Step 4: Use CAE to Configure a Component Access Mode

    In CAE, configure a load balancer access mode for the component and associate the load balancer with the CAE component. Then, access the CAE application through the public IP address.

Prerequisites

You have registered a Huawei account, enabled Huawei Cloud services, and logged in.

Step 1: Use CAE to Create an Environment and Application and View Network Information

Creating an Environment

  1. Log in to CAE.
  2. Click next to Environment in the upper part of the page.

  3. On the Create Environment page, set parameters by referring to Table 1. For details, see Creating an Environment.

    Table 1 Parameters for creating an environment

    Parameter

    Example Value

    Environment

    Enter env-test.

    Enterprise Project

    default is selected by default.

    Virtual Private Cloud

    Select vpc-cae (xxx.xxx.x.x/xx).

    Subnet

    Select subnet-2 (1xxx.xxx.x.x/xx).

    Security Group

    Select Use existing and then default from the drop-down list.

    Organization

    Select Create Organization from the drop-down list and enter a name, for example, group-test.

  4. Click OK.

Creating an Application

  1. Choose Components and click on the right of the Application module in the upper part of the page.

  2. Enter the application name app-test and click OK.

Viewing Network Information

  1. Choose Overview.
  2. In the lower part of the page, view the network information of the current environment and record the VPC and subnet information.

    When creating a dedicated load balancer, you need to set the VPC and subnet of the load balancer. The VPC and subnet must be the same as those of the CAE environment.

Step 2: Use CAE to Create a Nginx Component

  1. On the CAE console, choose Components in the navigation pane.
  2. In the upper part of the page, select the created environment (env-test) and application (app-test).
  3. Click Create Component. On the displayed page, set parameters by referring to Table 2. For details, see Creating a Component.

    Table 2 Parameters for creating a component

    Parameter

    Example Value

    Component

    Enter nginx-test.

    Version

    Enter 1.0.0.

    Specifications

    Select 0.5Core and 1GiB.

    Instances

    Set it to 1.

    Code Source

    1. Select Images.
    2. Select Open Source Images.
    3. Locate the Nginx image and select a Nginx image version, for example, mainline.

  4. Click Create and Deploy Component.
  5. In the displayed dialog box, confirm the component information and click Deploy Now.

Step 3: Use ELB to Create a Dedicated Load Balancer

  1. Log in to ELB.
  2. Click Buy Elastic Load Balancer and set parameters by referring to Table 3. For details, see Creating a Dedicated Load Balancer.

    Table 3 Parameters for creating a dedicated load balancer

    Parameter

    Example Value

    Type

    Select Dedicated load balancer.

    Billing Mode

    Select Pay-per-use.

    Region

    Select the region where the CAE environment is located.

    AZ

    Retain the default value.

    Name

    Enter elb-test.

    Enterprise Project

    Select default.

    Specifications

    1. Specification Type: Select Fixed.
    2. Select Network load balancing (TCP/UDP).
    3. Retain the default value.

    Network Type

    Select Private IPv4 network.

    VPC

    Select vpc-cae(xxx.xxx.x.x/xx) where the CAE environment is located.

    Frontend Subnet

    Select subnet-2 (xx.xx.xx.xx/xx) where the CAE environment is located.

    IPv4 Address

    Select Automatically assign IP address.

    Backend Subnet

    Select Subnet of the load balancer.

    IP as a Backend

    Retain the default value .

    EIP

    Select Auto assign. A new EIP will be assigned to the load balancer. For details about the parameters, see EIP.

    EIP Type

    Select Dynamic BGP.

    Billed By

    Select Traffic.

    Bandwidth (Mbit/s)

    Retain the default value.

  3. Click Buy Now.
  4. View the ELB and EIP information on the Elastic Load Balance page.

Step 4: Use CAE to Configure a Component Access Mode

  1. Log in to CAE.
  2. Choose Component Configurations.
  3. Click Edit on the Access Mode card.
  4. In the Access Component from Another Environment area, click Load Balancing > Add Load Balancer.

  5. On the Create Load Balancer page, set parameters by referring to Table 4.

    Table 4 Parameters for configuring a load balancer

    Parameter

    Example Value

    Load Balancer

    1. Select Dedicated.
    2. Select elb-test created in the previous step from the drop-down list.

    Health Check

    Select Enable.

    Access Control

    Select Allow all IP addresses.

    Port Settings

    1. Protocol: Select TCP.
    2. Listening Port: Enter 80.
    3. Access Port: Enter 80.

  6. Click OK.
  7. On the component configuration page, click Activate Settings > OK.
  8. The public IP address is displayed on the Access Mode card. It is the EIP that you purchased and bound to the dedicated load balancer in the previous step.
  9. Access the public IP address using a browser to view the Nginx static web page.