diff --git a/website/source/docs/jobspec/interpreted.html.md b/website/source/docs/jobspec/interpreted.html.md
index 81d79f7d6..1a06b2603 100644
--- a/website/source/docs/jobspec/interpreted.html.md
+++ b/website/source/docs/jobspec/interpreted.html.md
@@ -17,7 +17,7 @@ The syntax for interpreting variables is `${variable}`. An example and a
comprehensive list of interpretable fields can be seen below:
```hcl
-task "demo" {
+task "docs" {
driver = "docker"
# Drivers support interpreting node attributes and runtime environment
@@ -61,100 +61,126 @@ task "demo" {
## Node Variables
Below is a full listing of node attributes that are interpretable. These
-attributes are Interpreted by __both__ constraints and within the task and
+attributes are interpreted by __both__ constraints and within the task and
driver.
| Variable |
Description |
- Example |
+ Example Value |
- | ${node.unique.id} |
- The 36 character unique client node identifier |
- 9afa5da1-8f39-25a2-48dc-ba31fd7c0023 |
+ ${node.unique.id} |
+ 36 character unique client identifier |
+ 9afa5da1-8f39-25a2-48dc-ba31fd7c0023 |
- | ${node.datacenter} |
- The client node's datacenter |
- dc1 |
+ ${node.datacenter} |
+ Client's datacenter |
+ dc1 |
- | ${node.unique.name} |
- The client node's name |
- nomad-client-10-1-2-4 |
+ ${node.unique.name} |
+ Client's name |
+ nomad-client-10-1-2-4 |
- | ${node.class} |
- The client node's class |
- linux-64bit |
+ ${node.class} |
+ Client's class |
+ linux-64bit |
- | ${attr."key"} |
- The attribute given by `key` on the client node. |
- platform.aws.instance-type:r3.large |
+ ${attr.<property>} |
+ Property given by property on the client |
+ ${attr.arch} => amd64 |
- | ${meta."key"} |
- The metadata value given by `key` on the client node. |
- |
+ ${meta.<key>} |
+ Metadata value given by key on the client |
+ ${meta.foo} => bar |
-Below is a table documenting common node attributes:
+Below is a table documenting common node properties:
- | Attribute |
+ Property |
Description |
- | arch |
- CPU architecture of the client. Examples: `amd64`, `386` |
+ arch |
+ CPU architecture of the client (e.g. amd64, 386) |
- | consul.datacenter |
- The Consul datacenter of the client node if Consul found |
+ consul.datacenter |
+ The Consul datacenter of the client (if Consul is found) |
- | cpu.numcores |
+ cpu.numcores |
Number of CPU cores on the client |
- | driver."key" |
- See the [task drivers](/docs/drivers/index.html) for attribute documentation |
+ driver.<property> |
+ See the [task drivers](/docs/drivers/index.html) for property documentation |
- | unique.hostname |
+ unique.hostname |
Hostname of the client |
- | kernel.name |
- Kernel of the client. Examples: `linux`, `darwin` |
+ kernel.name |
+ Kernel of the client (e.g. linux, darwin) |
- | kernel.version |
- Version of the client kernel. Examples: `3.19.0-25-generic`, `15.0.0` |
+ kernel.version |
+ Version of the client kernel (e.g. 3.19.0-25-generic, 15.0.0) |
- | platform.aws.ami-id |
- On EC2, the AMI ID of the client node |
+ platform.aws.ami-id |
+ AMI ID of the client (if on AWS EC2) |
- | platform.aws.instance-type |
- On EC2, the instance type of the client node |
+ platform.aws.instance-type |
+ Instance type of the client (if on AWS EC2) |
- | os.name |
- Operating system of the client. Examples: `ubuntu`, `windows`, `darwin` |
+ os.name |
+ Operating system of the client (e.g. ubuntu, windows, darwin) |
- | os.version |
+ os.version |
Version of the client OS |
+Here are some examples of using node attributes and properties in a job file:
+
+```hcl
+job "docs" {
+ # This will constrain this job to only run on 64-bit clients.
+ constraint {
+ attribute = "${attr.arch}"
+ value = "amd64"
+ }
+
+ # This will restrict the job to only run on clients with 4 or more cores.
+ # Note: you may also declare a resource requirement for CPU for a task.
+ constraint {
+ attribute = "${cpu.numcores}"
+ operator = ">="
+ value = "4"
+ }
+
+ # Only run this job on a memory-optimized AWS EC2 instance.
+ constraint {
+ attribute = "${attr.platform.aws.instance-type}"
+ value = "m4.xlarge"
+ }
+}
+```
+
## Environment Variables
The following are runtime environment variables that describe the environment
@@ -167,68 +193,63 @@ a particular node and as such can not be used in constraints.
Description |
- | ${NOMAD_ALLOC_DIR} |
- The path to the shared `alloc/` directory. See
- [here](/docs/jobspec/environment.html#task_dir) for more
- information. |
+ ${NOMAD_ALLOC_DIR} |
+ The path to the shared alloc/ directory. See [here](/docs/jobspec/environment.html#task_dir) for more information. |
- | ${NOMAD_TASK_DIR} |
- The path to the task `local/` directory. See
- [here](/docs/jobspec/environment.html#task_dir) for more
- information. |
+ ${NOMAD_TASK_DIR} |
+ The path to the task local/ directory. See [here](/docs/jobspec/environment.html#task_dir) for more information. |
- | ${NOMAD_MEMORY_LIMIT} |
+ ${NOMAD_MEMORY_LIMIT} |
The memory limit in MBytes for the task |
- | ${NOMAD_CPU_LIMIT} |
+ ${NOMAD_CPU_LIMIT} |
The CPU limit in MHz for the task |
- | ${NOMAD_ALLOC_ID} |
+ ${NOMAD_ALLOC_ID} |
The allocation ID of the task |
- | ${NOMAD_ALLOC_NAME} |
+ ${NOMAD_ALLOC_NAME} |
The allocation name of the task |
- | ${NOMAD_ALLOC_INDEX} |
+ ${NOMAD_ALLOC_INDEX} |
The allocation index; useful to distinguish instances of task groups |
- | ${NOMAD_TASK_NAME} |
+ ${NOMAD_TASK_NAME} |
The task's name |
- | ${NOMAD_IP_"label"} |
- The IP for the given port `label`. See
+ | ${NOMAD_IP_<label>} |
+ The IP for the given port label. See
[here](/docs/jobspec/networking.html) for more information. |
- | ${NOMAD_PORT_"label"} |
- The port for the port `label`. See [here](/docs/jobspec/networking.html)
- for more information. |
+ ${NOMAD_PORT_<label>} |
+ The port for the port label. See [here](/docs/jobspec/networking.html) for more information. |
- | ${NOMAD_ADDR_"label"} |
- The `ip:port` pair for the given port `label`. See
+ | ${NOMAD_ADDR_<label>} |
+ The ip:port pair for the given port label. See
[here](/docs/jobspec/networking.html) for more information. |
- | ${NOMAD_HOST_PORT_"label"} |
+ ${NOMAD_HOST_PORT_<label>} |
The port on the host if port forwarding is being used for the port
- `label`. See [here](/docs/jobspec/networking.html#mapped_ports) for more
+ label. See [here](/docs/jobspec/networking.html#mapped_ports) for more
information. |
- | ${NOMAD_META_"key"} |
- The metadata value given by `key` on the task's metadata |
+ ${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. |
+ ${"env_key"} |
+ Interpret an environment variable with key env_key set on the task. |