0

I am deploying my application which contains three services by using Docker Swarm. As what i’ve read so far, Docker Swarm has a load-balancer to distribute container over Worker nodes automatically based on some internal factors. That is cool! but what i really need is a load-balancer which uses a set of parameters provided by me to distribute containers. Is it possible or it is too ambitious?
A set of parameters i mentioned here is obtained by running a script or code which calculate cpu usage, bandwidth, etc. Then its results will be passed to the load-balancer for distributing decision.

Thanks everyone for reading my post.

tgogos
  • 23,218
  • 20
  • 96
  • 128
hoango27
  • 89
  • 3
  • 11
  • 1
    When taking about load balancer, you normally refer to the distribution of traffic to already started containers on nodes in a swarm. What you seem to refer to is the scheduling of worker instances, or am I wrong? If you don't like the way swarm distribute the containers over nodes you could look at other schedulers such as kubernets. – F.Madsen Apr 08 '19 at 07:14

1 Answers1

0

Yes, this is perfectly possible but you will end up setting whole system on your own. You can also use Nginx for proxy, fetch metrics from docker swarm or prometheus and pass the info to script to generate the upstream in nginx and reload nginx.

Akash Sharma
  • 721
  • 3
  • 6