diff --git a/website/content/docs/job-specification/hcl2/variables.mdx b/website/content/docs/job-specification/hcl2/variables.mdx index 5a5f51483..fb820cf5b 100644 --- a/website/content/docs/job-specification/hcl2/variables.mdx +++ b/website/content/docs/job-specification/hcl2/variables.mdx @@ -14,12 +14,14 @@ job to be customized without altering the job's own source code. When you declare variables in the same file as the job specification, you can set their values using CLI options and environment variables. --> **Note:** For brevity, input variables are often referred to as just -"variables" or "Nomad variables" when it is clear from context what sort of -variable is being discussed. Other kinds of variables in Nomad include -_environment variables_ (set by the shell where Nomad runs) and _expression -variables_ (used to indirectly represent a value in an -[expression](/nomad/docs/job-specification/hcl2/expressions)). +-> **Note:** For brevity, input variables are sometimes referred to as just +"variables" when it is clear from context what sort of variable is being +discussed (related to HCL job files). They should not be confused with [Nomad +Variables][], which are useful for storing small pieces of configuration or +secret data accessible from Jobs at runtime. Other kinds of variables in Nomad +include [_environment variables_][] (set by the shell where Nomad runs) and +_expression variables_ (used to indirectly represent a value in an +[expression][]). ## Declaring an Input Variable @@ -327,3 +329,8 @@ this behavior optional : | var.foo | error, "foo needs to be set" | null | xy | | `NOMAD_VAR_foo=yz`
var.foo | yz | yz | yz | | `-var foo=yz`
var.foo | yz | yz | yz | + + +[Nomad Variables]: /nomad/docs/concepts/variables +[_environment variables_]: /nomad/docs/runtime/environment +[expression]: /nomad/docs/job-specification/hcl2/expressions diff --git a/website/content/docs/job-specification/template.mdx b/website/content/docs/job-specification/template.mdx index ca626cd8b..aeb16643f 100644 --- a/website/content/docs/job-specification/template.mdx +++ b/website/content/docs/job-specification/template.mdx @@ -69,7 +69,7 @@ refer to the [Learn Go Template Syntax][gt_learn] guide. - `destination` `(string: )` - Specifies the location where the resulting template should be rendered, relative to the [task working - directory]. Only drivers without filesystem isolation (ex. `raw_exec`) or + directory][]. Only drivers without filesystem isolation (ex. `raw_exec`) or that build a chroot in the task working directory (ex. `exec`) can render templates outside of the `NOMAD_ALLOC_DIR`, `NOMAD_TASK_DIR`, or `NOMAD_SECRETS_DIR`. For more details on how `destination` interacts with @@ -123,10 +123,11 @@ refer to the [Learn Go Template Syntax][gt_learn] guide. different delimiter that does not conflict with the output file itself. - `source` `(string: "")` - Specifies the path to the template to be rendered. - One of `source` or `data` must be specified, but not both. This source can - optionally be fetched using an [`artifact`][artifact] resource. This template - must exist on the machine prior to starting the task; it is not possible to - reference a template that's source is inside a Docker container, for example. + One of `source` or `data` must be specified, but not both. This source can be + fetched using an [`artifact`][artifact] resource. The template must exist in + the [task working directory][] prior to starting the task; it is not possible + to reference a template whose source is inside a Docker container, for + example. - `splay` `(string: "5s")` - Specifies a random amount of time to wait between 0 ms and the given splay value before invoking the change mode. This is @@ -398,7 +399,17 @@ EOH ### Nomad Variables -Nomad [variables] can be queried using the `nomadVar`, `nomadVarList`, + + +Using the Nomad integration results in an implicit dependency on the Nomad +servers. If the Nomad servers are unavailable (for example, a client is +disconnected), then after some retries, running allocations will be +stopped. Refer to the [`template.nomad_retry`][] client configuration option for +more details and to adjust the retry behaviour. + + + +Nomad [variables][] can be queried using the `nomadVar`, `nomadVarList`, `nomadVarListSafe`, and `nomadVarExists` functions. #### `nomadVarList` and `nomadVarListSafe` @@ -567,6 +578,15 @@ EOH ## Consul Integration + + +Using the Consul integration results in an implicit dependency on Consul. If +Consul is unavailable, then after some retries, running allocations will be +stopped. Refer to the [`template.consul_retry`][] client configuration option +for more details and to adjust the retry behaviour. + + + ### Consul KV Consul KV values can be accessed using the [`key`][ct_api_key] function to @@ -622,6 +642,15 @@ upstream {{ .Name | toLower }} { ## Vault Integration + + +Using the Vault integration results in an implicit dependency on Vault. If +Vault is unavailable, then after some retries, running allocations will be +stopped. Refer to the [`template.vault_retry`][] client configuration option +for more details and to adjust the retry behaviour. + + + ### PKI Certificate Vault is a popular open source tool for managing secrets. In addition to acting @@ -785,3 +814,6 @@ options](/nomad/docs/configuration/client#options): [variables]: /nomad/docs/concepts/variables [workload identity]: /nomad/docs/concepts/workload-identity [`time.Time`]: https://pkg.go.dev/time#Time +[`template.nomad_retry`]: /nomad/docs/configuration/client#nomad_retry +[`template.consul_retry`]: /nomad/docs/configuration/client#consul_retry +[`template.vault_retry`]: /nomad/docs/configuration/client#vault_retry