You can configure NSX-T load balancer integration with NCP for Kubernetes LoadBalancer services and Ingress resources.

Configuring a Kubernetes service of type LoadBalancer will create a layer 4 load balancer, and configuring a Kubernetes Ingress resource will create a layer 7 load balancer.

To configure load balancing, in the nsx-ncp-config ConfigMap:

  1. Set use_native_loadbalancer = True.
  2. (Optional) Set pool_algorithm to ROUND_ROBIN or LEAST_CONNECTION/IP_HASH. The default is ROUND_ROBIN.
  3. (Optional) Set service_size = SMALL, MEDIUM, or LARGE. The default is SMALL. In policy mode, set this value to match the pool allocation size of the tier-1 gateway.

The LEAST_CONNECTION/IP_HASH algorithm means that traffic from the same source IP address will be sent to the same backend pod.

For details about what NSX-T load balancers of different sizes support, see the NSX-T Data Center Administration Guide.

After the load balancer is created, the load balancer size cannot be changed by updating the configuration file. It can be changed through the NSX Manager UI or API.

You can configure an IPSet which will be populated with the IPs of all the virtual servers by NCP. To enable this feature, set the option lb_vs_ip_set in the nsx-ncp-config ConfigMap to be the name or UUID of an IPSet. The IPSet can be shared by multiple clusters. The IPs must be unique across all clusters. NCP will manage the allocation of the IPs.