-
Notifications
You must be signed in to change notification settings - Fork 2k
Consul service tokens derived from WI fail binding if service name is not all lowercase #25704
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
Comments
For the sake of completeness, here's the binding rule:
|
This appears to be the Consul side issue: hashicorp/consul#20373. What I'm seeing in summary:
Ergo, anyone relying on service names supporting capitalization (for example for using them as user-facing text strings) is now unable to upgrade to Nomad 1.10.0 as per best practices with WI service bound Consul ACLs. The workaround is to make a much much more lenient binding that allows write access to any service. This is obviously a bad idea, but probably(?) not any worse than the old approach where the registration was done anyway with wide permissions. Assuming that what Consul wants is sane and will stick, Nomad should:
|
Thanks for hunting that down @jinnatar. I suspect this isn't going to be able to be changed on the Consul side anytime soon.
Validation not matching the docs is definitely bad behavior on Nomad's part. From the perspective of backwards compatibility with existing services, this is going to be a little painful to resolve -- we need to make sure we're not causing outages during upgrades. I'll mark this for roadmapping. |
Yeah, all paths out of this seem painful. Off the top of my head:
I'd say an escalating ratchet of a quickly implemented planning WARN moving over to an eventual planning reject would give the most heads up but actually close the issue at some point. |
Agreed that logs are not the right approach here. Fortunately we have a mechanism in place already to emit warnings on job submission (which includes |
Nomad version
Nomad v1.9.7
BuildDate 2025-03-11T09:07:15Z
Revision f869597+CHANGES
(attempting to move to v1.10.0 but blocked by this issue)
Operating system and Environment details
Debian 12, native deb install of CE nomad & consul.
Issue
Following the WI for Consul tutorial I can successfully start jobs using the created example
service
type binding. However, if I change the servicename
to contain non-lowercase characters the binding does not allow write access to the capitalized service. Ergo, I'm inferring that somewhere along the way either Nomad or Consul implicitly lowercases the${value.nomad_service}
value.Reproduction steps
Identity-demo-dev
. This causes the following plan diff for theIdentity
block,ServiceName
correctly does not get lowercased here:Expected Result
Service is registered.
Actual Result
As per Consul logs:
If the job was purged before running the changed version the deployment fails due to service registration failing. If a purge is not done and it's an update, the service registration still fails but the task remains "healthy" and all seems fine from Nomad, but it sure ain't actually there in Consul.
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
The text was updated successfully, but these errors were encountered: