How is load balancing done in Docker-Swarm mode

自作多情 提交于 2019-12-02 20:27:57

when I write those apps which IP:PORT combination do I use? Is it any of the worker node IP's running these services?

You can use any node that is participating in the swarm, even if there is no replica of the service in question exists on that node. So you will use Node:HostPort combination. The ingress routing mesh will route the request to an active container.

One Picture Worth Ten Thousand Words

Will doing so take care of distributing the load appropriately even amongst other workers/manager running the same service?

The ingress controller will do round robin by default.

Now The clients should use dns round robin to access the service on the docker swarm nodes. The classic DNS cache problem will occur. To avoid that we can use external load balancer like HAproxy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!