Support updating template contents as in-place update
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
Currently, when using Consul Template expressions, the only option of ensuring that services experience no disruption is to configure a fixed splay interval across task restarts. This can be problematic when applications have prolonged and varying startup intervals, in which case there is no guarantee that services remain available. It can also be problematic when a change to a templated configuration file is erroneous, since those changes will eventually be rolled out to all allocations.
It would be convenient if Nomad’s deployment facilities could be leveraged to deploy newly rendered template output in a controlled way, e.g. by supporting `change_mode = "deployment"`.
I am aware that it has often been recommended to not use Nomad’s built-in Consul Template facilities to achieve redeployments. Instead, one might, e.g., run the Consul Template tool and re-submit jobs after template expansion. I believe this approach has some drawbacks that could ultimately only be avoided if Nomad itself could redeploy jobs on template changes. Some issues we have run into when trying to implement deployments triggered by template expressions follow below.
### Vault credentials
When expanding a templated job definition before submission, Vault credentials will be visible in the job definition shown by Nomad UIs. This would necessitate setting ACLs on the visibility of job definitions and making job definitions readable only by users who are also authorized to read secrets from Vault. For our use cases, it would mean that developers who might want to monitor jobs or deployments will not be able to see diffs between job versions.
### Injection of Nomad job definition language
When expanding templates prior to submission to Nomad, it would be possible that template values are crafted in a way that circumvents organization policies. E.g., input could be crafted to create additional Nomad tasks or manipulate Vault policies. Hence, expanding templates prior to job submission would introduce significant implementational cost to properly escape input.
### Waiting for unavailable values
When values read from Consul or Vault via Consul Template expressions are unavailable, Nomad UI shows helpful information that such values are unavailable and will queue the corresponding allocations. This UI would be lost if we were to handle templating prior to job submission.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.