allegro / marathon-consul

Integrates Marathon apps with Consul service discovery.
Apache License 2.0
191 stars 33 forks source link

marathon-consul should support multiple marathon clusters #261

Closed hokiegeek2 closed 6 years ago

hokiegeek2 commented 7 years ago

We have a multi-tenant environment that features nested marathon instances (marathons running inside a parent marathon). I attempted to use marathon-consul to register marathon tasks in one of our nested marathon instances. marathon-consul attempted to refresh tasks from the parent marathon via the nested marathon URL. The lookup failed and then all of the parent marathon tasks were de-registered from consul.

This opens up a larger question--should marathon-consul enable a 1..n relationship between consul and marathon? I believe so, because, otherwise, environments with multiple marathon clusters will not be able to use consul as the services and healthcheck system of record.

hokiegeek2 commented 7 years ago

In thinking about this, should be easy to implement. Just pass the marathon-location and/or marathon-leader info into the consul service description as a tag and then compare marathon-location/marathon-leader with corresponding tag in consul.

janisz commented 7 years ago

In current design Marathon-Cosnul support only one Marathon. This make code simple and easy to configure. If you have multiple marathons and only one Consul cluster you should run one marathon-consul for each Marathon and set different consul-tag for every installation. This will prevent single marathon-consul instance from unregistering instances running on different Marathon from Consul.

hokiegeek2 commented 7 years ago

Ah, cool! I figured you guys had a good solution to the issue I reported. I will test ASAP and close this issue.

Thanks

--John

hokiegeek2 commented 6 years ago

@janisz Forgot to close this. The consul-tag works great, closing this now