Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining routes in service metadata #566

Open
DavidRutqvist opened this issue Oct 30, 2018 · 8 comments
Open

Defining routes in service metadata #566

DavidRutqvist opened this issue Oct 30, 2018 · 8 comments

Comments

@DavidRutqvist
Copy link

Since the release of version 1.0.7 of Consul, services now have the possibility to provide arbitrary key-value attributes as service metadata. Using tags for metadata, as fabio makes use of, was the preferred way of specifying such attributes before the introduction of service metadata. However, with this new feature fabio should adopt and introduce support for specifying routes in the service metadata section since it is more well-suited.

Tags could perhaps be kept for backwards compatibility but the recommended way forward in the documentation should be to use metadata instead of tags. Since querying of metadata is not supported some "discovery tag" may still be required to avoid having to loop through all services but that could be some standard tag e.g. "fabio" or something more descriptive.

Related topic: hashicorp/consul#1107

@magiconair
Copy link
Contributor

Sounds good to me. This would also fit well into the refactor of the service monitor in #564. Do you feel like submitting a PR based on that code?

@aaronhurt
Copy link
Member

aaronhurt commented Oct 30, 2018

Completely removing the tag model would almost certainly break many deployments including our deployment. This would result in quite a bit of code change to solve a non-problem. I definitely see the appeal of service metadata but do not think the tag model should be abandoned.

@DavidRutqvist
Copy link
Author

Completely removing the tag model would almost certainly break many deployments including our deployment. This would result in quite a bit of code change to solve a non-problem. I definitely see the appeal of service metadata but do not think the tag model should be abandoned.

Yeah, that is why I proposed keeping it for backwards compatibility and only changing the documentation to gradually move towards service metadata.

@magiconair I could try finding time to submit a PR. I am a bit short of time during the following weeks but we'll see. It did not seem to difficult to add this kind of support.

Any suggestions for "discovery tag". Currently fabio searches for the prefix "urlprefix-", this does not seem to be a candidate according to me.

@DavidRutqvist
Copy link
Author

Yesterday I started implementing this. To do this we obviously have to update the Consul dependency to a later version. After doing this I realised there is a lot of changes which is not necessary to this use case. Only the newly added ServiceMeta field to the CatalogService is needed in order to fulfill this use case.

What are your thoughts on this @magiconair ? Should we update the whole API-catalog or just add the field to the CatalogService struct?

@aaronhurt
Copy link
Member

aaronhurt commented Nov 15, 2018

@DavidRutqvist I'll build and test a local version with v1.4.0 to support service metadata and consul connect.

@DavidRutqvist
Copy link
Author

@DavidRutqvist I'll build and test a local version with v1.4.0 to support service metadata and consul connect.

Super, I'll leave this to you then. It will be very much appreciated.

@aaronhurt
Copy link
Member

I updated consul to v1.4.0 in #571

@chenjpu
Copy link

chenjpu commented Feb 20, 2019

Is there progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants