Layer 4 load balancers
Layer 4 of the OSI model is responsible for protocols such as TCP and UDP. A load balancer that is running in layer 4 accepts incoming traffic based on the only IP address and port. The incoming request is accepted by the load balancer, and based on a set of rules, the traffic is sent to the destination IP address and port.
There are lower-level networking operations in the process that are out of the scope of this book. HAproxy has a good summary of the terminology and example configurations on their website at https://www.haproxy.com/fr/blog/loadbalancing-faq/.
Layer 4 load balancer options
There are multiple options available to you if you want to configure a layer 4 load balancer for a Kubernetes cluster. Some of the options include the following:
- HAproxy
- NGINX Pro
- SeeSaw
- F5 Networks
- MetalLB
- And more…
Each option provides layer 4 load balancing, but for the purpose of this book, we felt that MetalLB was the...