Updated on 2024-06-17 GMT+08:00

Ingress-NGINX for Load Balancing at Layer 7

The Ingress-NGINX controller is used to store NGINX configuration and implement unified traffic forwarding. For details about Ingress-NGINX, see Ingress-NGINX Controller and official community projects.

This section describes how you can install and use Ingress-NGINX for an on-premises cluster.

Constraints

Currently, Ingress-NGINX can be installed only in on-premises clusters.

Installing Ingress-NGINX

  1. Log in to the UCS console.
  2. In the navigation pane on the left, choose Operator Service Center. On the Service Center tab, search for Ingress-NGINX and click this add-on to go to its details page.

    Figure 1 Searching for Ingress-NGINX

  3. Subscribe to Ingress-NGINX, click Create Instance, and select the target cluster.

    • If MetalLB has been installed in the cluster, you can use the load balancing capability of MetalLB to expose Ingress-NGINX to external networks and install Ingress-NGINX as prompted.
    • If MetalLB is not installed in the cluster, Ingress-NGINX can be exposed only with the help of NodePort.
    You need to change the value of .values.controller.service.type from LoadBalancer to NodePort before installing Ingress-NGINX, as shown in Figure 2.
    Figure 2 Changing the parameter value

Function Verification

  1. Log in to the UCS console.

    • If the cluster is not added to any fleet, click the cluster name.
    • If the cluster has been added to a fleet, click the fleet name. In the navigation pane on the left, choose Clusters > Container Clusters. Then, click the cluster name to access the cluster console.

  2. In the navigation pane on the left, choose Workloads. Then, click Create from Image.
  3. Select an available image to create a workload. In Service Settings, click to add a Service of type ClusterIP. For details, see Workload Service Configuration.
  4. In the navigation pane on the left, choose Services & Ingresses. Then, click the Ingresses tab, click Create Ingress, and select the Service of type ClusterIP. For details about how to configure an ingress, see Ingresses.
  5. Access this Service to verify that the forwarding rule is successfully configured.

    • If this Service is exposed by LoadBalancer, select the Service of type LoadBalancer to make the Service reachable outside the cluster.

    • If this Service is exposed by NodePort, select any node and use the Service port to make the Service reachable outside the cluster.