On Mon, Nov 6, 2017 at 7:59 PM, Norman Branitsky <
[email protected]> wrote:

> I just found out another group has started deploying microservice based
> apps on Docker Swarm
>
> using Traefik <https://docs.traefik.io/> saying:
>
>
> “we are starting to deploy applications designed as microservices , but
> have chosen Traefik for our ability
> to dynamically add sites based on Docker Service label.”
>
>
>
> Having read the docs, it appears to be reasonable for internal exposure
> only.
> With respect to dynamic configuration based on Docker Service label,
>
> how does this compare vis a vis HAProxy?
>
>
>
>
>
Hi,

As mentioned by Soluti, you need a "controller" whose main tasks will be:
- watch the orchestrator (or registry)
- generates the configuration accordingly to changes in the orchestrator
(or registry)
- applies the configuration changes (some of them can be applied at run
time, some of them will require a reload)

You can have a look to this project too:
https://github.com/jcmoraisjr/haproxy-ingress
It applies to Kubenetes and embeds some logic to apply changes at runtime
whenever possible.


Now, about Swarm itself, it's a bit messy... First, I'll speak about Swarm
mode only (because the other one seems deprecated).
You need to monitor events for "services" changes. From there, you need to
get the "task list" for each service, so it will give you the list of IPs
where the application is available.
All your application(s) server(s) must run in an overlay network, where
HAProxy has a "leg" too (otherwise HAProxy won't be able to reach the IPs
above). I let you imagine the nightmare from a design point of view...
Last, you have to do the http routing. Nothing is provided by Swarm mode
yet for this purpose. So you must use labels, as traefik has designed it.

Baptiste

Reply via email to