Configuring Load
Balancing
You can configure
NSX
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:
- Setuse_native_loadbalancer=True.
- (Optional) Setpool_algorithmtoROUND_ROBINorLEAST_CONNECTION/IP_HASH. The default isROUND_ROBIN.
- (Optional) Setservice_size=SMALL,MEDIUM, orLARGE. The default isSMALL. 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
load balancers of different sizes support,
see the . 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.