Updated on 2023-07-07 GMT+08:00

LoadBalancer

A workload can be accessed from a public network through a load balancer. This access type is applicable to Services that need to be exposed to a public network in the system. The access address is in the format of <IP address of public network load balancer>:<access port>, for example, 10.117.117.117:80.

Prerequisites

A workload is available. If no workload is available, create one by following the procedure described in Deployments.

Setting the Access Type

  1. Log in to the MCP console. In the navigation pane, choose Resource Management > Network Management. On the page displayed, click Create Service under the Services tab.
  2. Set access parameters.

    • Service Name: Name of the Service to be created, which can be self-defined.
    • Namespace: Namespace to which the service belongs.
    • Access Type: Select LoadBalancer.
    • Workload: Select an associated workload.
    • Port Configuration
      • Protocol: Select the protocol used by the Service.
      • Container Port: Port on which the workload listens. For example, the Nginx application listens on port 80 (container port).
      • Access Port: Specify a port to map a container port to the ELB service. The port range is 1–65535. The port will be used when the application is accessed through the ELB service.
    • Domain Name: Domain name used for access.
    • Cluster: The cluster on which the Service is to be deployed is the same as that on which workload is deployed. It cannot be manually selected.

  3. Click Next and customize cluster configurations. Enhanced load balancers can be configured for each cluster.

    • Huawei Cloud: Select an existing load balancer or let the system automatically create one. If you select Automatically create, click Change Load Balancer Specifications, and modify the specifications, billing mode, and bandwidth of the enhanced load balancer to be created.
      Figure 1 Customized LoadBalancer Service settings - Huawei Cloud
    • Other clouds: The access annotation supports the key-value pair format. Alibaba Cloud is used as an example.Configure labels based on your service and vendor requirements.
      Figure 2 Customized LoadBalancer Service settings - Alibaba Cloud
      • To create an internal load balancer, add annotations based on the cloud service provider of your cluster. For details, see Internal load balancer.

  4. Click Create. After the Service is created, you can configure domain name access to interconnect the Service of the LoadBalancer type with the DNS service.
  5. Obtain the access address.

    1. Click Cluster Console in the upper part of the page to access the cluster console.
    2. On the cluster console, choose Workloads > Deployments, click the name of the added workload to access the details page, and click View Access Mode to obtain the access address.