traefik icon indicating copy to clipboard operation
traefik copied to clipboard

Consul Catalog - Multi DC

Open rogeriollacerda opened this issue 9 years ago • 8 comments

Can traefik get containers from more than one datacenter on Consul? We use consul to manage applications of our 3 datacenters.

rogeriollacerda avatar Jul 19 '16 18:07 rogeriollacerda

it's only looking at the dc of the local agent. making the dc configurable would be trivial. supporting multiple dcs at once is a bit hairy. ideally traefik core would be able to multiplex the same provider with different configs.

btw my setup has a traefik for each dc that is also configured with its own domain.

keis avatar Jul 21 '16 18:07 keis

You may be able to implement that by allowing traefik to use prepared queries instead of the service Api. Check the last sample in the above link. The user would have to give to traefik the prepared query he made in consul.

DBuret avatar May 28 '19 20:05 DBuret

if its a duplicate, then how to handle queries instead of services?

ghost avatar Aug 06 '19 15:08 ghost

Any updates here?

vvershkov avatar Oct 03 '19 16:10 vvershkov

Would like to see this also. A nice use case would be to have a percentage of traffic be sent to the other consul data center service.

codyja avatar Mar 05 '20 15:03 codyja

This would be great. It could really come in handy when trying to hit a local service if available, but fail over to instances in another data center if necessary.

ddreier avatar Apr 19 '21 19:04 ddreier

Also a nod from me this would be helpful in our cloud/on prem hybrid setups

keslerm avatar Sep 07 '21 23:09 keslerm

When I define a resolver configuration entry to fail over the service to a different datacenter, it works great with the consul ingress gateway, but doesn't work with Traefik. :/

vvarga007 avatar Jul 27 '22 01:07 vvarga007

Will this feature be implemented ?

xenofree avatar Oct 20 '22 12:10 xenofree

I'd be happy to look into creating a pull request for this, given a small bit of guidance. Adding prepared query support shouldn't be all that difficult, but where to put the integration in Traefik is in question. It isn't part of "Consul Catalog", but it does feel closely related and would essentially perform all of the same functions as the Catalog provider, just via different API calls to get the services. Should this be a wholly separate provider or should it be an addition to the Catalog provider? My feeling is that we could apply all of the same configuration to both catalog and prepared query lookups and simply combine the results, but im open to suggestions.

jhitt25 avatar May 23 '23 15:05 jhitt25

Any update on this?

vvarga007 avatar Sep 21 '23 13:09 vvarga007