diff --git a/website/source/docs/runtime/_envvars.html.md.erb b/website/source/docs/runtime/_envvars.html.md.erb new file mode 100644 index 000000000..da624437f --- /dev/null +++ b/website/source/docs/runtime/_envvars.html.md.erb @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableDescription
NOMAD_ALLOC_DIR + The path to the shared alloc/ directory. See + [here](/docs/runtime/environment.html#task-directories) for more + information. +
NOMAD_TASK_DIR + The path to the task local/ directory. See + [here](/docs/runtime/environment.html#task-directories) for more + information. +
NOMAD_SECRETS_DIR + Path to the task's secrets directory. See + [here](/docs/runtime/environment.html#task-directories) for more + information. +
NOMAD_MEMORY_LIMITMemory limit in MB for the task
NOMAD_CPU_LIMITCPU limit in MHz for the task
NOMAD_ALLOC_IDAllocation ID of the task
NOMAD_ALLOC_NAMEAllocation name of the task
NOMAD_ALLOC_INDEXAllocation index; useful to distinguish instances of task groups. From 0 to (count - 1).
NOMAD_TASK_NAMETask's name
NOMAD_JOB_NAMEJob's name
NOMAD_DCDatacenter in which the allocation is running
NOMAD_REGIONRegion in which the allocation is running
NOMAD_META_<key>The metadata value given by key on the task's metadata
VAULT_TOKENThe task's Vault token. See [Vault Integration](/docs/vault-integration/index.html) for more details
Network-related Variables
NOMAD_IP_<label> + IP for the given port label. Driver-specified IP when available, + otherwise the host's IP. See [here](/docs/job-specification/network.html) + for more information. +
NOMAD_PORT_<label> + Port for the given port label. 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. +
NOMAD_ADDR_<label> + *Deprecated:* The ip:port pair for the given port + label. 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. +
NOMAD_HOST_IP_<label> + IP of the host for the port label. See + [here](/docs/job-specification/network.html#mapped_ports) for more + information. +
NOMAD_HOST_PORT_<label> + Port on the host for the port label. See + [here](/docs/job-specification/network.html#mapped_ports) for more + information. +
NOMAD_HOST_ADDR_<label> + The host's ip:port pair for the given port label. See + [here](/docs/job-specification/network.html#mapped_ports) for more + information. +
NOMAD_DRIVER_IP_<label> + IP from the driver for the port label 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. +
NOMAD_DRIVER_PORT_<label> + Port in the driver for the port label if a port map is + configured. See [here](/docs/job-specification/network.html#mapped_ports) + for more information. +
NOMAD_DRIVER_ADDR_<label> + The driver's ip:port pair for the given port label if + the driver configured an IP and port. See + [here](/docs/job-specification/network.html#mapped_ports) for more + information. +
diff --git a/website/source/docs/runtime/environment.html.md b/website/source/docs/runtime/environment.html.md.erb similarity index 65% rename from website/source/docs/runtime/environment.html.md rename to website/source/docs/runtime/environment.html.md.erb index 3e0c03293..3a0fbde08 100644 --- a/website/source/docs/runtime/environment.html.md +++ b/website/source/docs/runtime/environment.html.md.erb @@ -15,96 +15,7 @@ environment variables. ## Summary - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VariableDescription
`NOMAD_ALLOC_DIR`Path to the shared alloc directory
`NOMAD_TASK_DIR`Path to the local task directory
`NOMAD_SECRETS_DIR`Path to the task's secrets directory
`NOMAD_MEMORY_LIMIT`The task's memory limit in MB
`NOMAD_CPU_LIMIT`The task's CPU limit in MHz
`NOMAD_ALLOC_ID`The allocation ID of the task
`NOMAD_ALLOC_NAME`The allocation name of the task
`NOMAD_ALLOC_INDEX`The allocation index; useful to distinguish instances of task groups
`NOMAD_TASK_NAME`The task's name
`NOMAD_JOB_NAME`The job's name
`NOMAD_DC`The datacenter in which the allocation is running
`NOMAD_REGION`The region in which the allocation is running
`NOMAD_IP_The IP of the port with the given label
`NOMAD_PORT_The port value with the given label
`NOMAD_ADDR_The IP:Port pair of the port with the given label
`NOMAD_ADDR__The allocated address, given as IP:Port for the given label of other tasks in the same group
`NOMAD_PORT__The allocated port for the given label of other tasks in the same group
`NOMAD_IP__The allocated IP address for the given label of other tasks in the same group
`NOMAD_HOST_PORT_The host port for the given label if the port is port mapped
`NOMAD_META_`The metadata of the task
`VAULT_TOKEN`The task's Vault token. See [Vault Integration](/docs/vault-integration/index.html) for more details
+<%= 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 diff --git a/website/source/docs/runtime/interpolation.html.md b/website/source/docs/runtime/interpolation.html.md.erb similarity index 69% rename from website/source/docs/runtime/interpolation.html.md rename to website/source/docs/runtime/interpolation.html.md.erb index b23917967..b5f9cb6b8 100644 --- a/website/source/docs/runtime/interpolation.html.md +++ b/website/source/docs/runtime/interpolation.html.md.erb @@ -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. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VariableDescription
${NOMAD_ALLOC_DIR}The path to the shared alloc/ directory. See [here](/docs/runtime/environment.html#task-directories) for more information.
${NOMAD_TASK_DIR}The path to the task local/ directory. See [here](/docs/runtime/environment.html#task-directories) for more information.
${NOMAD_MEMORY_LIMIT}The memory limit in MBytes for the task
${NOMAD_CPU_LIMIT}The CPU limit in MHz for the task
${NOMAD_ALLOC_ID}The allocation ID of the task
${NOMAD_ALLOC_NAME}The allocation name of the task
${NOMAD_ALLOC_INDEX}The allocation index; useful to distinguish instances of task groups. From 0 to (count - 1).
${NOMAD_TASK_NAME}The task's name
${NOMAD_JOB_NAME}The job's name
${NOMAD_IP_<label>}The IP for the given port label. See - [here](/docs/job-specification/network.html) for more information.
${NOMAD_PORT_<label>}The port for the port label. See [here](/docs/job-specification/network.html) for more information.
${NOMAD_ADDR_<label>}The ip:port pair for the given port label. See - [here](/docs/job-specification/network.html) for more information.
${NOMAD_HOST_PORT_<label>}The port on the host if port forwarding is being used for the port - label. See [here](/docs/job-specification/network.html#mapped_ports) for more - information.
${NOMAD_META_<key>}The metadata value given by key on the task's metadata
${"env_key"}Interpret an environment variable with key env_key set on the task.
+Environment variables should be enclosed in brackets `${...}` for +interpolation. + +<%= partial "envvars.html.md" %>