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

Ingresses

Enhanced load balancer is used for an ingress. Compared with layer-4 load balancing, layer-7 load balancing newly supports Uniform Resource Identifiers (URI) configurations and distributes access traffic to the corresponding service based on the corresponding URIs. In addition, different functions are implemented based on various URIs. The access address is in the format of <IP address of public network load balancer>:<access port><defined URI>, for example, 10.117.117.117:80/helloworld.

Prerequisites

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

Methods of 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 Ingress under the Ingresses tab.
  2. Set general configuration parameters. General configurations refer to common parameter settings for all clusters.

    • Ingress Name: Name of the ingress to be created, which can be self-defined.
    • Namespace: Namespace to which the ingress belongs.
    • Cluster: Select the cluster on which the ingress is to be deployed. If you select a CCE cluster, ensure that a NodePort Service has been created. For details on how to create a NodePort Service, see NodePort.

  3. Click Next and customize cluster configurations.

    Customized cluster configurations on Huawei Cloud
    • ELB: Select an existing load balancer or let the system automatically create one.
      • If you select an existing load balancer, make sure that the load balancer and the selected cluster belong to the same VPC and subnet.
      • If you set the load balancer type to Public network and select Automatically create, you can click Change Load Balancer Specifications, and modify the specifications, billing mode, and bandwidth of the instance to be created.
    • External Protocol: HTTP and HTTPS are supported.
    • Key Certificate: If External Protocol is set to HTTPS, select a key certificate.
    • External Port: Port number that is open to the ELB service address. The port number can be specified randomly.
    • Domain Name: Enter a domain name, for example, example.com.
    • Route Configuration
      • Route Match Rule: Prefix matching, Exact matching, and Regular expression matching are available.
        • Prefix matching: If the URL is set to /healthz, the URL that meets the prefix can be accessed. For example, /healthz/v1 and /healthz/v2.
        • Exact matching: Only the URL that is the same as the specified URL can be accessed. For example, if the URL is set to /healthz, only /healthz can be accessed.
        • Regular expression matching: The URL rule can be set, for example, /[A-Za-z0-9_.-]+/test. All URLs that comply with this rule can be accessed, for example, /abcA9/test and /v1-Ab/test. Two regular expression standards are supported: POSIX and Perl.
      • Mapping URL: Enter a mapping URL.
      • Service Name: Select a Service name.
      • Container Port: Select a container port.
    Customized cluster configuration on other clouds
    • Annotations: For details about the parameters in the metadata.annotations field, see the documentation of the corresponding cloud service provider.
    • External Protocol: HTTP and HTTPS are supported.
    • Key Certificate: If External Protocol is set to HTTPS, select a key certificate.
    • Domain Name: Enter a domain name, for example, example.com.
    • Route Configuration
      • Mapping URL: Enter a mapping URL.
      • Service Name: Select a Service name.
      • Container Port: Select a container port.

  4. Click Create. After the ingress is created, you can view it in the list on the Ingresses tab page.
  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.