open-nomad/jobspec/test-fixtures
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
..
artifacts.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
bad-artifact.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
bad-ports.hcl run "make hclfmt" 2020-02-03 12:15:53 -05:00
basic.hcl run "make hclfmt" 2020-02-03 12:15:53 -05:00
basic_wrong_key.hcl run "make hclfmt" 2020-02-03 12:15:53 -05:00
default-job.hcl
distinctHosts-constraint.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
distinctProperty-constraint.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
incorrect-service-def.hcl run "make hclfmt" 2020-02-03 12:15:53 -05:00
job-with-kill-signal.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
migrate-job.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
multi-network.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
multi-resource.hcl chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
multi-vault.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
overlapping-ports.hcl run "make hclfmt" 2020-02-03 12:15:53 -05:00
parameterized_job.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
periodic-cron.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
regexp-constraint.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
reschedule-job-unlimited.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
reschedule-job.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
service-check-bad-header-2.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
service-check-bad-header.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
service-check-driver-address.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
service-check-initial-status.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
service-check-restart.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
service-enable-tag-override.hcl client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
service-meta.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
set-contains-constraint.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
specify-job.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
task-nested-config.hcl Implement configuration validation for all task drivers 2016-04-10 00:42:57 +02:00
tg-network.hcl shutdown delay for task groups 2019-12-16 11:38:16 -05:00
tg-service-check.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
tg-service-enable-tag-override.hcl client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
vault_inheritance.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00
version-constraint.hcl chore: initial hclfmt 2019-10-11 14:00:05 +02:00