BalanceD is a Layer-4 Linux Virtual Server (LVS) based load balancing platform for Kubernetes.
It is capable of providing basic load balancing for any Kubernetes cluster and is reliable and performant. This is achieved by utilizing LVS (also known as IPVS - IP Virtual Server), along with any Consistent-Hashing algorithm, to implement a stateless Direct-Server-Return (DSR) Layer-4 load balancer. The stateless nature means it can be horizontally scaled with the help of AnyCast and ECMP.
Above all, it is designed with modularity in mind which makes BalanceD very simple to operate and maintain.
BalanceD is meant to be placed alongside an existing Kubernetes networking solution, and is NOT a turnkey solution for Kubernetes networking such as kube-router, which was an inspiration for this project.
BalanceD is being used in several production clusters to power the most demanding online game services at Demonware! Core functionality is considered stable.
BalanceD requires two LVS/IPVS nodes at minimum for redundancy purposes - these can either be physical machines or virtual instances. Each node must be part of the Kubernetes cluster and can route to all Pods through their respective Pod IPs. Each node must be configured to act as BGP peers to advertise the VIP addresses to the rest of the network. For flexibility, BalanceD does not bundle a BGP speaker allowing for a more seamless integration with the network. A BIRD configuration is available here as a reference.
BalanceD has been tested on versions Kubernetes >= 1.9. If kube-proxy is running in IPVS mode, the ipvs-controller
of BalanceD must run in Pod Networking Mode to avoid conflict with IPVS.
BalanceD was tested to operate on Linux kernels >= 4.4. However, it should work in theory with any modern kernels with decent LVS/IPVS support.
This has been tested to work with:
make images
to build all controllers.
Go version 1.12 or above is required to build BalanceD
make build
to build all controllers.
BalanceD is built upon following open-source libraries:
- go-iptables: https://github.com/coreos/go-iptables
- netlink: https://github.com/vishvananda/netlink
- libnetwork: https://github.com/docker/libnetwork
and many more!
BalanceD has also been inspired by:
Feel free to leave feedback or raise any questions by opening an issue here.
We encourage all kinds of contributions! Feel free to submit a PR!