-
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
Tasks not getting restarted when secret used in template is updated #4397
Comments
This looks similar #4226- we will work on reproducing on our end. |
Ok, let me know if I can provide any more details. As a work-around I am setting very short TTL on the secrets. See discussion here: https://gitter.im/hashicorp-nomad/Lobby?at=5b1a7adcdd54362753f79ee7 |
@lzrski Hey I am going to close this. Unlike Consul, Vault doesn't have a mechanism for blocking queries to get notified when a value changes. The tunable for staleness with vault is the secret TTL. |
Thanks for clarification @dadgar Frankly I wouldn't consider this issue to be resolved. At least Nomad and Consul Template docs should clearly explain the way TTL works. The Nomad docs imply that changing secrets will restart the task: https://www.nomadproject.io/docs/job-specification/template.html (there is no clear distinction between Consul's If one reads it very carefully (as I just did) it's possible to infer the mechanics from the section about As a further improvement, I would like the lease times to be be configurable outside of the vault, so that processes with only I appreciate your hard work on all the projects and I know how difficult it is to write good docs. Above critique is backed by best intentions 🙂 |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Nomad version
Nomad v0.8.4-rc1 (26e6ffd1c42fcf300b213d80257765d4ae94e24d)
Operating system and Environment details
Ubuntu 16.04
Vault version:
Everything backed by Consul. Version:
Issue
The task using template stanza with
change_mode = "restart"
is not getting restarted when value of a secret changes.Reproduction steps
When I run the job below initially both
${secret}
and${public}
are populated as expected. When I change value in Consul, the task gets restarted as expected. But when I write new value to Vault:Nothing happens.
When I explicitly stop and start the job again:
then the new secret value is there.
Perhaps I'm missing something, but I would expect the task to be restarted as soon as I put a new value for the secret (as it happens with values coming from Consul).
I'm not sure if it's relevant, but Vault uses TLS, whereas neither Nomad nor Consul do. I'm currently working on it.
Nomad Server and Client logs
My Nomad instances are running both client and server, so the logs are combined. Below is the output from
journalctl --follow --unit=nomad.service
. Empty lines and lines starting with--
are added by me.During all these there are no logs at all from active Vault instance. Maybe I should increase verbosity?
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: