-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Automatically tagging services with agent specific tags #545
Comments
Could you clarify the use case a bit more? |
Sure, using an example, imagine there is a new configurable variable for the consul agent, inherit_tags: ["foo", "bar"]. Now anytime a service is registered through this agent, the tags "foo" and "bar" are automatically applied to that service. This greatly simplifies service definitions when there are tags that are common to all services started from the same node (or group of nodes). For example, if you tag a consul agent as "staging", then all services started from that machine will also be tagged "staging". |
I understand. I think for now this doesn't seem broadly useful to me, and is probably better solved in the tools that are generating the service definitions rather than in Consul itself. |
The https://www.consul.io/docs/agent/options.html#node_meta feature should meet this need, and you can search the catalog by this for nodes and services. |
* add options to customize the dns service (fixes hashicorp#545)
It would be useful to be able to configure a set of default_tags in the agent that are automatically applied to any service registered with that agent.
Example Usecase: A situation where machines in a network are grouped together (eg. group-foo, group-bar). At the moment, when a service is registered from a machine from "group-foo", each service's service definition needs to explicitly specify the tag "group-foo". With this proposed feature, the user only needs to specify the default_tags=["group_foo"] for consul agent, and any service registering through the agent would automatically get the "group-foo" tag.
An alternate method would be to able to allow tagging the consul agents (instead of adding tags to the service), and during querying, one could restrict results only to certain agent tags.
The text was updated successfully, but these errors were encountered: