-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add support for consul EnableTagOverride #5775
Add support for consul EnableTagOverride #5775
Conversation
@bogdanalbei please fix linting errors using gofmt - https://travis-ci.org/hashicorp/nomad/jobs/541187845 |
nomad/command/agent/consul/client.go Lines 91 to 98 in 168e3e9
AgentService tags are a superset of the service registration definition - otherwise Nomad will revert them every time it reconciles with Consul.
There may also be potential issues if other state causes the service to be re-registered (that could drop unmanaged tags), such as when promoting canary deployments. |
you're right @endocrimes, I updated the code such that if EnableTagOverride is set, then the Consul tags are being kept and not overridden. I tested the change end to end and it works as expected.
|
It would be really great if this could be merged in. I have an application that needs to dynamically add and remove fabio Would be great if I could offload the service lifecycle to nomad, and merely perform the updates in process. edit - jira markup has ruined me. |
@bogdanalbei I've targetted this for ~0.10.0, but I'd like to hold off merging till after #6197 merges. If you could rebase after that I'll take a look again 👍 |
Thanks for the PR, @bogdanalbei! I started looking into this and realized there's some non-obvious complexity around the stateful house-keeping between Nomad's view of a service definition and what is maintained by each Consul agent. In short, we need to keep track of why a service is being synchronized with the agent, so that we can switch on that knowledge and make the right changes accordingly. There's a more detailed explanation in #7106 I'll go ahead and close this out; the ability to configure |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
At the moment the Consul's EnableTagOverride flag not being set by Nomad, so the default(false) is always used. In certain cases it is useful for services outside Nomad to update the tags of the Consul services, however for that to happen EnableTagOverride has to be set to true.
This change enables setting EnableTagOverride at a service level.
An older request describing this can be found here #2057