pblb
is an experimental load-balancer written in Go. It can't do many things
a production load-balancer can do and—for that reason—should not be used in a
production setting.
Clone the repository locally and then go install
to install the binary on your
path. However, for quick testing, I'd recommend using docker-compose
(see
"Usage").
If you want to quickly test pblb
I'd recommend using the included
docker-compose.yaml
. Running docker-compose up
will set up three NGINX nodes
and the load-balancer configured to these nodes. Once all services are up, you
can hit http://localhost:2839 to see th load-balancer in action, or visit
http://localhost:2840 for prometheus metrics of the load-balancer.
Look at the included config.yaml
for an example, but I will cover the
highlights here.
method
: This field takes a string representation of what load-balancing method to use. Currently, the only options areroundrobin
andtwochoice
.nodes
: This field is an array of dictionaries representing each node to be load-balanced.address
: IP/Host Name address to the node.port
: Port to serve traffic to.health
: Endpoint to perform health checks on.