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

consul: fingerprint Consul Enterprise admin partitions #19485

Merged
merged 1 commit into from Dec 15, 2023

Conversation

tgross
Copy link
Member

@tgross tgross commented Dec 14, 2023

Consul Enterprise agents all belong to an admin partition. Fingerprint this attribute when available. When a Consul agent is not explicitly configured with "default" it is in the default partition but will not report this in its /v1/agent/self endpoint. Fallback to "default" when missing only for Consul Enterprise.

This feature provides users the ability to add constraints for jobs to land on Nomad nodes that have a Consul in that partition. Or it can allow cluster administrators to pair Consul partitions 1:1 with Nomad node pools. We'll also have the option to implement a future partition field in the jobspec's consul block to create an implicit constraint.

Ref: #13139 (comment)

Consul Enterprise agents all belong to an admin partition. Fingerprint this
attribute when available. When a Consul agent is not explicitly configured with
"default" it is in the default partition but will not report this in its
`/v1/agent/self` endpoint. Fallback to "default" when missing only for Consul
Enterprise.

This feature provides users the ability to add constraints for jobs to land on
Nomad nodes that have a Consul in that partition. Or it can allow cluster
administrators to pair Consul partitions 1:1 with Nomad node pools. We'll also
have the option to implement a future `partition` field in the jobspec's
`consul` block to create an implicit constraint.

Ref: #13139 (comment)
Copy link
Contributor

@pkazmierczak pkazmierczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgross tgross added the backport/1.7.x backport to 1.7.x release line label Dec 15, 2023
@tgross tgross merged commit 2e33115 into main Dec 15, 2023
21 checks passed
@tgross tgross deleted the consul-partition-fingerprint branch December 15, 2023 14:26
tgross added a commit that referenced this pull request Jan 8, 2024
Add support for Consul Enterprise admin partitions. We added fingerprinting in
#19485. This PR adds a `consul.partition`
field. The expectation is that most users will create a mapping of Nomad node
pool to Consul admin partition. But we'll also create an implicit constraint for
the fingerprinted value.

Fixes: #13139
tgross added a commit that referenced this pull request Jan 8, 2024
Add support for Consul Enterprise admin partitions. We added fingerprinting in
#19485. This PR adds a `consul.partition`
field. The expectation is that most users will create a mapping of Nomad node
pool to Consul admin partition. But we'll also create an implicit constraint for
the fingerprinted value.

Fixes: #13139
tgross added a commit that referenced this pull request Jan 10, 2024
Add support for Consul Enterprise admin partitions. We added fingerprinting in
#19485. This PR adds a `consul.partition`
field. The expectation is that most users will create a mapping of Nomad node
pool to Consul admin partition. But we'll also create an implicit constraint for
the fingerprinted value.

Fixes: #13139
@roman-vynar
Copy link
Contributor

After upgrade from 1.7.2 > 1.7.3 nomad clients are logging warnings:

    2024-01-17T13:45:14.344Z [WARN]  client.fingerprint_mgr.consul: unable to fingerprint consul: cluster=default attribute=consul.partition
    2024-01-17T13:45:45.976Z [WARN]  client.fingerprint_mgr.consul: unable to fingerprint consul: cluster=default attribute=consul.partition
    2024-01-17T13:46:25.551Z [WARN]  client.fingerprint_mgr.consul: unable to fingerprint consul: cluster=default attribute=consul.partition
    2024-01-17T13:47:17.873Z [WARN]  client.fingerprint_mgr.consul: unable to fingerprint consul: cluster=default attribute=consul.partition
    2024-01-17T13:48:19.299Z [WARN]  client.fingerprint_mgr.consul: unable to fingerprint consul: cluster=default attribute=consul.partition

@tgross
Copy link
Member Author

tgross commented Jan 17, 2024

Opened #19756. Just for future reference, it's almost always going to be better to report new issues rather than comment on closed PRs. It's very easy to miss these notifications.

tgross added a commit that referenced this pull request Feb 8, 2024
Support for fingerprinting the Consul admin partition was added in #19485. But
when the client fingerprints Consul CE, it gets a valid fingerprint and working
Consul but with a warn-level log. Return "ok" from the partition extractor, but
also ensure that we only add the Consul attribute if it actually has a value.

Fixes: #19756
tgross added a commit that referenced this pull request Feb 9, 2024
Support for fingerprinting the Consul admin partition was added in #19485. But
when the client fingerprints Consul CE, it gets a valid fingerprint and working
Consul but with a warn-level log. Return "ok" from the partition extractor, but
also ensure that we only add the Consul attribute if it actually has a value.

Fixes: #19756
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
Consul Enterprise agents all belong to an admin partition. Fingerprint this
attribute when available. When a Consul agent is not explicitly configured with
"default" it is in the default partition but will not report this in its
`/v1/agent/self` endpoint. Fallback to "default" when missing only for Consul
Enterprise.

This feature provides users the ability to add constraints for jobs to land on
Nomad nodes that have a Consul in that partition. Or it can allow cluster
administrators to pair Consul partitions 1:1 with Nomad node pools. We'll also
have the option to implement a future `partition` field in the jobspec's
`consul` block to create an implicit constraint.

Ref: hashicorp#13139 (comment)
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
Add support for Consul Enterprise admin partitions. We added fingerprinting in
hashicorp#19485. This PR adds a `consul.partition`
field. The expectation is that most users will create a mapping of Nomad node
pool to Consul admin partition. But we'll also create an implicit constraint for
the fingerprinted value.

Fixes: hashicorp#13139
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
…p#19923)

Support for fingerprinting the Consul admin partition was added in hashicorp#19485. But
when the client fingerprints Consul CE, it gets a valid fingerprint and working
Consul but with a warn-level log. Return "ok" from the partition extractor, but
also ensure that we only add the Consul attribute if it actually has a value.

Fixes: hashicorp#19756
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
Consul Enterprise agents all belong to an admin partition. Fingerprint this
attribute when available. When a Consul agent is not explicitly configured with
"default" it is in the default partition but will not report this in its
`/v1/agent/self` endpoint. Fallback to "default" when missing only for Consul
Enterprise.

This feature provides users the ability to add constraints for jobs to land on
Nomad nodes that have a Consul in that partition. Or it can allow cluster
administrators to pair Consul partitions 1:1 with Nomad node pools. We'll also
have the option to implement a future `partition` field in the jobspec's
`consul` block to create an implicit constraint.

Ref: hashicorp#13139 (comment)
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
Add support for Consul Enterprise admin partitions. We added fingerprinting in
hashicorp#19485. This PR adds a `consul.partition`
field. The expectation is that most users will create a mapping of Nomad node
pool to Consul admin partition. But we'll also create an implicit constraint for
the fingerprinted value.

Fixes: hashicorp#13139
nvanthao pushed a commit to nvanthao/nomad that referenced this pull request Mar 1, 2024
…p#19923)

Support for fingerprinting the Consul admin partition was added in hashicorp#19485. But
when the client fingerprints Consul CE, it gets a valid fingerprint and working
Consul but with a warn-level log. Return "ok" from the partition extractor, but
also ensure that we only add the Consul attribute if it actually has a value.

Fixes: hashicorp#19756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants