Introduction to Network Load Balancer
Overview of Load Balancing in OpenStack
A Network Load Balancer (NLB) is a component in cloud environments like OpenStack, ensuring the efficient distribution of incoming network traffic across multiple servers or instances. By spreading requests evenly, a load balancer helps to maximize the availability and reliability of applications, ensuring that no single instance becomes overwhelmed.
In OpenStack, load balancers are typically used to:
- Distribute user traffic to multiple backend instances, improving response times.
- Increase fault tolerance by rerouting traffic when an instance becomes unresponsive.
- Support scaling applications by adding or removing instances in response to demand.
Focus on OVN Load Balancer
In this documentation, we focus on using the OVN (Open Virtual Network) load balancer as the provider. Unlike other load balancer providers like Amphora, which relies on dedicated virtual machines to handle load balancing, OVN load balancers are built directly into the network infrastructure. This can offer benefits like:
- Lower overhead: No need to maintain additional VMs for load balancing.
- Simplified architecture: Direct integration with the underlying network reduces complexity.
Note that neither OVN nor Amphora-based load balancers have an implementation in the Horizon Dashboard, so both types are managed through OpenStack CLI commands.
Key Concepts
Before diving into the configuration of an OVN Load Balancer, it’s important to understand some of the core concepts:
-
Virtual IP (VIP): The IP address that the load balancer uses to accept traffic. The load balancer then distributes this traffic to one or more backend servers. It is advised that it be a private IP in the same tenant network as the backend VM IPs. To enable external access, a floating IP (public IP) can be attached to the port holding the load balancer VIP.
-
Listeners: Define how the load balancer listens for incoming traffic, specifying the protocol (e.g., TCP) and port. A listener acts as the entry point for client requests.
-
Pools: A pool is a collection of backend instances (e.g., VMs) that receive traffic distributed by the load balancer. Pools can use different algorithms to determine how traffic is distributed.
-
Load Balancing Algorithms: The method used by the load balancer to distribute traffic among the pool members. Currently, only SOURCE_IP_PORT algorithm is supported.
- SOURCE_IP_PORT: Distributes traffic based on the source IP and port, maintaining session persistence for users by consistently routing their requests to the same backend instance. This is especially useful for applications requiring a stable user experience.
-
Health Monitors: A health monitor regularly checks the availability of the pool members, ensuring that traffic is only directed to healthy instances. If a pool member fails the check the specified number of times, its operating status is set to 'ERROR' and the member is excluded from traffic distribution. However, the monitoring continues. If the instance becomes healthy again, its operating status is set to 'ONLINE', and traffic will be routed to it again.