Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow configuring frontend for backend from another provider #3695
Do you want to request a feature or report a bug?
What did you expect to see?
I'd like to add a frontend for a backend from another provider. In my particular case I want to implement a blue-green deployment setting with multiple backends from the consul provider and configuring a frontend for one of these backends from the file provider. I can't announce the required frontend through consul itself because I need an instantaneous switch from one backend to another on config reload.
This is somewhat a simpler version of #1122, because there is no need to balance load between backends from different providers but just a direct relation from one frontend to one backend config.
Implementing this would be backwards incompatible if you have unintentional name collisions between backends of different providers (which is improbable). I would expect adding the provider name to the frontend's backend parameter explicitly (or some kind of more global config) would be needed to get around this.
Please let me know what you think about this proposal and how probable it is to get a PR implementing it added.
I am working hard to try find way to do that as well!
I guess the way is use tags.
Yeah, tags definitely make it easier. In our case we have an application that is started by nomad. We usually set tags that include the routing rules so that our applications respond to the correct urls, however, in this case the application allows the creation of subdomains dynamically inside the app. So we need to dynamically add in routing rules into the frontend to allow those subdomains to work.
Generally, we could have just used a regex to match all subdomains, however, we already have an application that does that. This application needs to match only a specific subset of domains - the rest need to fall through to that other application.
What I had wanted to do, was to create frontend definitions in consul (not catalog) and have those point to the backends referenced in the consul_catalog. Then we could have our software push updates to the consul path that stores the route rules for that frontend as domains are added and removed. This would be picked up by traefik and the routing rules would be in place.
This does, however, require the ability to point our frontend in the consul provider to the backends created in the consul_catalog provider.
For now, the subdomains are not added all that often, so we are just going to trigger a redeploy of the nomad app when one is added (which will semi-dynamically add in new routing rules), however, that's really all sorts of awful.