open-nomad/api
Seth Hoenig 0e44094d1a client: enable configuring enable_tag_override for services
Consul provides a feature of Service Definitions where the tags
associated with a service can be modified through the Catalog API,
overriding the value(s) configured in the agent's service configuration.

To enable this feature, the flag enable_tag_override must be configured
in the service definition.

Previously, Nomad did not allow configuring this flag, and thus the default
value of false was used. Now, it is configurable.

Because Nomad itself acts as a state machine around the the service definitions
of the tasks it manages, it's worth describing what happens when this feature
is enabled and why.

Consider the basic case where there is no Nomad, and your service is provided
to consul as a boring JSON file. The ultimate source of truth for the definition
of that service is the file, and is stored in the agent. Later, Consul performs
"anti-entropy" which synchronizes the Catalog (stored only the leaders). Then
with enable_tag_override=true, the tags field is available for "external"
modification through the Catalog API (rather than directly configuring the
service definition file, or using the Agent API). The important observation
is that if the service definition ever changes (i.e. the file is changed &
config reloaded OR the Agent API is used to modify the service), those
"external" tag values are thrown away, and the new service definition is
once again the source of truth.

In the Nomad case, Nomad itself is the source of truth over the Agent in
the same way the JSON file was the source of truth in the example above.
That means any time Nomad sets a new service definition, any externally
configured tags are going to be replaced. When does this happen? Only on
major lifecycle events, for example when a task is modified because of an
updated job spec from the 'nomad job run <existing>' command. Otherwise,
Nomad's periodic re-sync's with Consul will now no longer try to restore
the externally modified tag values (as long as enable_tag_override=true).

Fixes #2057
2020-02-10 08:00:55 -06:00
..
contexts
internal/testutil
acl.go
acl_test.go
agent.go refactor api profile methods 2020-01-09 15:15:12 -05:00
agent_test.go fix tests, update changelog 2020-01-29 13:55:39 -05:00
allocations.go cli: recover from client ACL lookup failures 2019-10-04 11:23:59 -04:00
allocations_test.go api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
api.go Add raw field for ClientCert and ClientKey 2019-12-16 14:30:00 +01:00
api_test.go api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
compose_test.go fix tests from introducing new struct fields 2019-07-31 01:03:16 -04:00
constraint.go core: add semver constraint 2019-11-19 08:40:19 -08:00
constraint_test.go
deployments.go
evaluations.go add create and modify timestamps to evaluations (#5881) 2019-08-07 09:50:35 -07:00
evaluations_test.go
fs.go cli: recover from client ACL lookup failures 2019-10-04 11:23:59 -04:00
fs_test.go
go.mod Update go mod 2019-12-16 12:47:10 +01:00
go.sum Update go mod 2019-12-16 12:47:10 +01:00
jobs.go command, docs: create and document consul token configuration for connect acls (gh-6716) 2020-01-31 19:02:53 -06:00
jobs_test.go command, docs: create and document consul token configuration for connect acls (gh-6716) 2020-01-31 19:02:53 -06:00
namespace.go
namespace_test.go
nodes.go api: add StartedAt in Node.DrainStrategy 2019-11-13 17:54:40 -05:00
nodes_test.go
operator.go
operator_autopilot.go
operator_test.go
quota.go
quota_test.go
raw.go
regions.go
regions_test.go
resources.go cli: display group ports and address in alloc status command output (#6189) 2019-08-27 23:59:36 -04:00
search.go
search_test.go
sentinel.go
sentinel_test.go
services.go client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
services_test.go client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
status.go
status_test.go
system.go
system_test.go
tasks.go shutdown delay for task groups 2019-12-16 11:38:16 -05:00
tasks_test.go volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00
util_test.go api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
utils.go
utils_test.go