mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Consolidate envvars in a partial template
This commit is contained in:
151
website/source/docs/runtime/_envvars.html.md.erb
Normal file
151
website/source/docs/runtime/_envvars.html.md.erb
Normal file
@@ -0,0 +1,151 @@
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_ALLOC_DIR</tt></td>
|
||||
<td>
|
||||
The path to the shared <tt>alloc/</tt> directory. See
|
||||
[here](/docs/runtime/environment.html#task-directories) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_TASK_DIR</tt></td>
|
||||
<td>
|
||||
The path to the task <tt>local/</tt> directory. See
|
||||
[here](/docs/runtime/environment.html#task-directories) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_SECRETS_DIR</tt></td>
|
||||
<td>
|
||||
Path to the task's secrets directory. See
|
||||
[here](/docs/runtime/environment.html#task-directories) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_MEMORY_LIMIT</tt></td>
|
||||
<td>Memory limit in MB for the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_CPU_LIMIT</tt></td>
|
||||
<td>CPU limit in MHz for the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_ALLOC_ID</tt></td>
|
||||
<td>Allocation ID of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_ALLOC_NAME</tt></td>
|
||||
<td>Allocation name of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_ALLOC_INDEX</tt></td>
|
||||
<td>Allocation index; useful to distinguish instances of task groups. From 0 to (count - 1).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_TASK_NAME</tt></td>
|
||||
<td>Task's name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_JOB_NAME</tt></td>
|
||||
<td>Job's name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_DC</tt></td>
|
||||
<td>Datacenter in which the allocation is running</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_REGION</tt></td>
|
||||
<td>Region in which the allocation is running</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_META_<key></tt></td>
|
||||
<td>The metadata value given by <tt>key</tt> on the task's metadata</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>VAULT_TOKEN</tt></td>
|
||||
<td>The task's Vault token. See [Vault Integration](/docs/vault-integration/index.html) for more details</td>
|
||||
</tr>
|
||||
<tr><th colspan="2">Network-related Variables</th></tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_IP_<label></tt></td>
|
||||
<td>
|
||||
IP for the given port <tt>label</tt>. Driver-specified IP when available,
|
||||
otherwise the host's IP. See [here](/docs/job-specification/network.html)
|
||||
for more information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_PORT_<label></tt></td>
|
||||
<td>
|
||||
Port for the given port <tt>label</tt>. Driver-specified port when a port
|
||||
map is used, otherwise the host's static or dynamic port allocation. See
|
||||
[here](/docs/job-specification/network.html) for more information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_ADDR_<label></tt></td>
|
||||
<td>
|
||||
*Deprecated:* The <tt>ip:port</tt> pair for the given port
|
||||
<tt>label</tt>. For backward compatibility it always uses the host's IP
|
||||
but will use the drvier's port if a port map is used. Use the
|
||||
corresponding `HOST` or `DRIVER` variables instead as they have explicit
|
||||
predictable values.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_HOST_IP_<label></tt></td>
|
||||
<td>
|
||||
IP of the host for the port <tt>label</tt>. See
|
||||
[here](/docs/job-specification/network.html#mapped_ports) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_HOST_PORT_<label></tt></td>
|
||||
<td>
|
||||
Port on the host for the port <tt>label</tt>. See
|
||||
[here](/docs/job-specification/network.html#mapped_ports) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_HOST_ADDR_<label></tt></td>
|
||||
<td>
|
||||
The host's <tt>ip:port</tt> pair for the given port <tt>label</tt>. See
|
||||
[here](/docs/job-specification/network.html#mapped_ports) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_DRIVER_IP_<label></tt></td>
|
||||
<td>
|
||||
IP from the driver for the port <tt>label</tt> if the driver configured
|
||||
an IP. Not available until after the task is started. See
|
||||
[here](/docs/job-specification/network.html#mapped_ports) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_DRIVER_PORT_<label></tt></td>
|
||||
<td>
|
||||
Port in the driver for the port <tt>label</tt> if a port map is
|
||||
configured. See [here](/docs/job-specification/network.html#mapped_ports)
|
||||
for more information.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>NOMAD_DRIVER_ADDR_<label></tt></td>
|
||||
<td>
|
||||
The driver's <tt>ip:port</tt> pair for the given port <tt>label</tt> if
|
||||
the driver configured an IP and port. See
|
||||
[here](/docs/job-specification/network.html#mapped_ports) for more
|
||||
information.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -15,96 +15,7 @@ environment variables.
|
||||
|
||||
## Summary
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_ALLOC_DIR`</td>
|
||||
<td>Path to the shared alloc directory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_TASK_DIR`</td>
|
||||
<td>Path to the local task directory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_SECRETS_DIR`</td>
|
||||
<td>Path to the task's secrets directory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_MEMORY_LIMIT`</td>
|
||||
<td>The task's memory limit in MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_CPU_LIMIT`</td>
|
||||
<td>The task's CPU limit in MHz</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_ALLOC_ID`</td>
|
||||
<td>The allocation ID of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_ALLOC_NAME`</td>
|
||||
<td>The allocation name of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_ALLOC_INDEX`</td>
|
||||
<td>The allocation index; useful to distinguish instances of task groups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_TASK_NAME`</td>
|
||||
<td>The task's name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_JOB_NAME`</td>
|
||||
<td>The job's name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_DC`</td>
|
||||
<td>The datacenter in which the allocation is running</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_REGION`</td>
|
||||
<td>The region in which the allocation is running</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_IP_<label>`</td>
|
||||
<td>The IP of the port with the given label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_PORT_<label>`</td>
|
||||
<td>The port value with the given label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_ADDR_<label>`</td>
|
||||
<td>The IP:Port pair of the port with the given label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_ADDR_<task>_<label>`</td>
|
||||
<td>The allocated address, given as IP:Port for the given label of other tasks in the same group</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_PORT_<task>_<label>`</td>
|
||||
<td>The allocated port for the given label of other tasks in the same group</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_IP_<task>_<label>`</td>
|
||||
<td>The allocated IP address for the given label of other tasks in the same group</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_HOST_PORT_<label>`</td>
|
||||
<td>The host port for the given label if the port is port mapped</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`NOMAD_META_<key>`</td>
|
||||
<td>The metadata of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`VAULT_TOKEN`</td>
|
||||
<td>The task's Vault token. See [Vault Integration](/docs/vault-integration/index.html) for more details</td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= partial "envvars.html.md" %>
|
||||
|
||||
~> Port labels and task names will have any non-alphanumeric or underscore
|
||||
characters in their names replaced by underscores `_` when they're used in
|
||||
@@ -192,73 +192,7 @@ The following are runtime environment variables that describe the environment
|
||||
the task is running in. These are only defined once the task has been placed on
|
||||
a particular node and as such can not be used in constraints.
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_ALLOC_DIR}</tt></td>
|
||||
<td>The path to the shared <tt>alloc/</tt> directory. See [here](/docs/runtime/environment.html#task-directories) for more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_TASK_DIR}</tt></td>
|
||||
<td>The path to the task <tt>local/</tt> directory. See [here](/docs/runtime/environment.html#task-directories) for more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_MEMORY_LIMIT}</tt></td>
|
||||
<td>The memory limit in MBytes for the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_CPU_LIMIT}</tt></td>
|
||||
<td>The CPU limit in MHz for the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_ALLOC_ID}</tt></td>
|
||||
<td>The allocation ID of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_ALLOC_NAME}</tt></td>
|
||||
<td>The allocation name of the task</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_ALLOC_INDEX}</tt></td>
|
||||
<td>The allocation index; useful to distinguish instances of task groups. From 0 to (count - 1).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_TASK_NAME}</tt></td>
|
||||
<td>The task's name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_JOB_NAME}</tt></td>
|
||||
<td>The job's name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_IP_<label>}</tt></td>
|
||||
<td>The IP for the given port <tt>label</tt>. See
|
||||
[here](/docs/job-specification/network.html) for more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_PORT_<label>}</tt></td>
|
||||
<td>The port for the port <tt>label</tt>. See [here](/docs/job-specification/network.html) for more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_ADDR_<label>}</tt></td>
|
||||
<td>The <tt>ip:port</tt> pair for the given port <tt>label</tt>. See
|
||||
[here](/docs/job-specification/network.html) for more information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_HOST_PORT_<label>}</tt></td>
|
||||
<td>The port on the host if port forwarding is being used for the port
|
||||
<tt>label</tt>. See [here](/docs/job-specification/network.html#mapped_ports) for more
|
||||
information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${NOMAD_META_<key>}</tt></td>
|
||||
<td>The metadata value given by <tt>key</tt> on the task's metadata</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>${"env_key"}</tt></td>
|
||||
<td>Interpret an environment variable with key <tt>env_key</tt> set on the task.</td>
|
||||
</tr>
|
||||
</table>
|
||||
Environment variables should be enclosed in brackets `${...}` for
|
||||
interpolation.
|
||||
|
||||
<%= partial "envvars.html.md" %>
|
||||
Reference in New Issue
Block a user