Public | Automated Build

Last pushed: 2 years ago
Short Description
Loadbalancer based on nginx, consul and swarm. Can be used with overlay networks ( see github )
Full Description

djeemz/loadbalancer

This swarm-loadbalancer is build on top of NGINX.
Using Consul as a key-value store and works with overlay networks.

Get it up and running

Create an overlay network or use one you already created and run the loadbalancer container.

The loadbalancer container uses Hashicorp's Consul together with consul-template to fill it's configuration file.

At the moment gliderlabs/registrator service can't handle overlay networks (PR is open). Kidibox created a fork with the PR merged.

$ docker network create --subnet 10.0.0.0/24 -d overlay myoverlay
$ docker run -d --name loadbalancer-1 --restart=always --net myoverlay --env constraint:node==swarm-node-1.vm -p 80:80 -e CONSUL_URL=ip:8500 djeemz/loadbalancer
$ docker run -d --name registrator-1 --restart=always --volume /var/run/docker.sock:/tmp/docker.sock --net myoverlay kidibox/registrator -internal consul://ip:8500

Adding more overlay networks to the loadbalancer seems a bit buggy. To solve this use docker network to connect:

$ docker network connect myoverlay2 loadbalancer-1
Docker Pull Command
Owner
djeemz
Source Repository