-
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
Consul ACL token is not recreated if deleted #20185
Comments
Hi @lgfa29 it's important for us to have this fixed before stating to use identities for consul on nomad. Is there any way I can help fix this? We set a low max_ttl on the consul auth method and hit this. I guess that by how this works we shouldn't set a max_ttl for the nomad auth method in consul, but in any case we can't allow being unable to update services in a node if for any reason a token is deleted. |
Hi @jorgemarey! Luiz has moved on from HashiCorp, but I've flagged this for prioritization. There's a bit of an architectural challenge here in that the For example, we could pass that token to a template runner and the template runner will hit an error, but there's currently no message channel available for us to say "uh oh, that token is now gone" and get it recreated (and not just recreated but re-polled #23381). I'd also have to look into what would happen here to ex. an Envoy sidecar proxy. |
Hi @tgross thanks for the information. Maybe there could be a channel in the AllocHookResources struct for this kind of events? |
With the caveat that I haven't dug in too far here, yeah the |
I've got a docs PR up #24167 which will close this issue as wontfix. Although we could built out a facility for recreating the Consul tokens, Consul doesn't support refreshing tokens. This means it's impossible to update the Envoy sidecar proxies for Consul Service Mesh workloads without tearing down the proxy. Which is precisely what's happening when the tokens get deleted anyways. |
As of #24166, Nomad agents will use their own token to deregister services and checks from Consul. This returns the deregistration path to the pre-Workload Identity workflow. Expand the documentation to make clear why certain ACL policies are required for clients. Additionally, we did not explicitly call out that auth methods should not set an expiration on Consul tokens. Nomad does not have a facility to refresh these tokens if they expire. Even if Nomad could, there's no way to re-inject them into Envoy sidecars for Consul Service Mesh without recreating the task anyways, which is what happens today. Warn users that they should not set an expiration. Closes: #20185 (wontfix) Ref: https://hashicorp.atlassian.net/browse/NET-10262
As of #24166, Nomad agents will use their own token to deregister services and checks from Consul. This returns the deregistration path to the pre-Workload Identity workflow. Expand the documentation to make clear why certain ACL policies are required for clients. Additionally, we did not explicitly call out that auth methods should not set an expiration on Consul tokens. Nomad does not have a facility to refresh these tokens if they expire. Even if Nomad could, there's no way to re-inject them into Envoy sidecars for Consul Service Mesh without recreating the task anyways, which is what happens today. Warn users that they should not set an expiration. Closes: #20185 (wontfix) Ref: https://hashicorp.atlassian.net/browse/NET-10262
Nomad version
Issue
When using Consul with workload identities, if the ACL token is deleted from Consul it is never recreated and causes the sync loop to fail and exit early, skipping other updates.
Reproduction steps
Expected Result
A new token is created and the service meta is updated.
Actual Result
Service is not updated and the
sync
loop fails, exiting early and preventing other updates as well.The text was updated successfully, but these errors were encountered: