github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/partials/envvars.mdx (about)

     1  | Variable                                                     | Description                                                                                                                                                                                                                                                                                                          |
     2  | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     3  | `NOMAD_ALLOC_DIR`                                            | The path to the shared `alloc/` directory. See [here](/docs/runtime/environment#task-directories) for more information.                                                                                                                                                                                              |
     4  | `NOMAD_TASK_DIR`                                             | The path to the task `local/` directory. See [here](/docs/runtime/environment#task-directories) for more information.                                                                                                                                                                                                |
     5  | `NOMAD_SECRETS_DIR`                                          | Path to the task's secrets directory. See [here](/docs/runtime/environment#task-directories) for more information.                                                                                                                                                                                                   |
     6  | `NOMAD_MEMORY_LIMIT`                                         | Memory limit in MB for the task                                                                                                                                                                                                                                                                                      |
     7  | `NOMAD_MEMORY_MAX_LIMIT`                                     | The maximum memory limit the task may use if client has excess memory capacity, in MB. Omitted if task isn't configured with memory oversubscription.                                                                                                                                                                |
     8  | `NOMAD_CPU_LIMIT`                                            | CPU limit in MHz for the task                                                                                                                                                                                                                                                                                        |
     9  | `NOMAD_CPU_CORES`                                            | The specific CPU cores reserved for the task in cpuset list notation. Omitted if the task does not request cpu cores. E.g. `0-2,7,12-14`                                                                                                                                                                             |
    10  | `NOMAD_ALLOC_ID`                                             | Allocation ID of the task                                                                                                                                                                                                                                                                                            |
    11  | `NOMAD_SHORT_ALLOC_ID`                                       | The first 8 characters of the allocation ID of the task                                                                                                                                                                                                                                                              |
    12  | `NOMAD_ALLOC_NAME`                                           | Allocation name of the task                                                                                                                                                                                                                                                                                          |
    13  | `NOMAD_ALLOC_INDEX`                                          | Allocation index; useful to distinguish instances of task groups. From 0 to (count - 1). The index is unique within a given version of a job, but canaries or failed tasks in a deployment may reuse the index.                                                                                                      |
    14  | `NOMAD_TASK_NAME`                                            | Task's name                                                                                                                                                                                                                                                                                                          |
    15  | `NOMAD_GROUP_NAME`                                           | Group's name                                                                                                                                                                                                                                                                                                         |
    16  | `NOMAD_JOB_ID`                                               | Job's ID, which is equal to the Job name when submitted through CLI but can be different when using the API                                                                                                                                                                                                          |
    17  | `NOMAD_JOB_NAME`                                             | Job's name                                                                                                                                                                                                                                                                                                           |
    18  | `NOMAD_JOB_PARENT_ID`                                        | ID of the Job's parent if it has one                                                                                                                                                                                                                                                                                 |
    19  | `NOMAD_DC`                                                   | Datacenter in which the allocation is running                                                                                                                                                                                                                                                                        |
    20  | `NOMAD_PARENT_CGROUP`                                        | The parent cgroup used to contain task cgroups (Linux only)                                                                                                                                                                                                                                                          |
    21  | `NOMAD_NAMESPACE`                                            | Namespace in which the allocation is running                                                                                                                                                                                                                                                                         |
    22  | `NOMAD_REGION`                                               | Region in which the allocation is running                                                                                                                                                                                                                                                                            |
    23  | `NOMAD_META_<key>`                                                | The metadata value given by `key` on the task's metadata. Note that this is different from [`${meta.<key>}`](/docs/runtime/interpolation#node-variables-) which are keys in the node's metadata.                                                                                                                          |
    24  | `VAULT_TOKEN`                                                | The task's Vault token. See [Vault Integration](/docs/integrations/vault-integration) for more details                                                                                                                                                                                                                            |
    25  | **Network-related Variables**                                |
    26  | `NOMAD_IP_<label>`                                                  | Host IP for the given port `label`. See [here for more](/docs/job-specification/network) information.                                                                                                                                                                                                                |
    27  | `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. Services should bind to this port. See [here for more](/docs/job-specification/network) information.                                                                         |
    28  | `NOMAD_ADDR_<label>`                                                | Host `IP:Port` pair for the given port `label`.                                                                                                                                                                                                                                                                      |
    29  | `NOMAD_HOST_PORT_<label>`                                           | Port on the host for the port `label`. See [here](/docs/job-specification/network#mapped-ports) for more information.                                                                                                                                                                                                |
    30  | `NOMAD_IP_<task>_<label>`                                                 | **Deprecated**. Host IP for the given port `label` and `task` for tasks in the same task group. Only available when setting ports via the task resource network port mapping.                                                                                                                                        |
    31  | `NOMAD_PORT_<task>_<label>`                                               | **Deprecated**. Port for the given port `label` and `task` for tasks in the same task group. Driver-specified port when a port map is used, otherwise the host's static or dynamic port allocation. Services should bind to this port. Only available when setting ports via the task resource network port mapping. |
    32  | `NOMAD_ADDR_<task>_<label>`                                               | **Deprecated**. Host `IP:Port` pair for the given port `label` and `task` for tasks in the same task group. Only available when setting ports via the task resource network port mapping.                                                                                                                            |
    33  | `NOMAD_HOST_PORT_<task>_<label>`                                          | **Deprecated**. Port on the host for the port `label` and `task` for tasks in the same task group. Only available when setting ports via the task resource network port mapping.                                                                                                                                     |
    34  | `NOMAD_UPSTREAM_IP_<service>`                                         | IP for the given `service` when defined as a Consul Connect [upstream](/docs/job-specification/upstreams).                                                                                                                                                                                                           |
    35  | `NOMAD_UPSTREAM_PORT_<service>`                                       | Port for the given `service` when defined as a Consul Connect [upstream](/docs/job-specification/upstreams).                                                                                                                                                                                                         |
    36  | `NOMAD_UPSTREAM_ADDR_<service>`                                       | Host `IP:Port` for the given `service` when defined as a Consul Connect [upstream](/docs/job-specification/upstreams).                                                                                                                                                                                               |
    37  | `NOMAD_ENVOY_ADMIN_ADDR_<service>`                                    | Local address `127.0.0.2:Port` for the admin port of the envoy sidecar for the given `service` when defined as a Consul Connect enabled service. Envoy runs inside the group network namespace unless configured for host networking.                                                                                |
    38  | `NOMAD_ENVOY_READY_ADDR_<service>`                                    | Local address `127.0.0.1:Port` for the ready port of the envoy sidecar for the given `service` when defined as a Consul Connect enabled service. Envoy runs inside the group network namespace unless configured for host networking.                                                                                |
    39  | **Consul-related Variables** (only set for connect native tasks) |
    40  | `CONSUL_HTTP_ADDR`                                           | Specifies the address to the local Consul agent. Will be automatically set to a unix domain socket in bridge networking mode, or a tcp address in host networking mode.                                                                                                                                              |
    41  | `CONSUL_HTTP_TOKEN`                                          | Specifies the Consul ACL token used to authorize with Consul. Will be automatically set to a generated Connect service identity token specific to the service instance if Consul ACLs are enabled.                                                                                                                   |
    42  | `CONSUL_HTTP_SSL`                                            | Specifies whether HTTPS should be used when communicating with consul. Will be automatically set to true if Nomad is configured to communicate with Consul using TLS.                                                                                                                                                |
    43  | `CONSUL_HTTP_SSL_VERIFY`                                     | Specifies whether the HTTPS connection with Consul should be mutually verified. Will be automatically set to true if Nomad is configured to verify TLS certificates.                                                                                                                                                 |
    44  | `CONSUL_CACERT`                                              | Specifies the path to the CA certificate used for Consul communication. Will be automatically set if Nomad is configured with the `consul.share_ssl` option.                                                                                                                                                         |
    45  | `CONSUL_CLIENT_CERT`                                         | Specifies the path to the Client certificate used for Consul communication. Will be automatically set if Nomad is configured with the `consul.share_ssl` option.                                                                                                                                                     |
    46  | `CONSUL_CLIENT_KEY`                                          | Specifies the path to the CLient Key certificate used for Consul communication. Will be automatically set if Nomad is configured with the `consul.share_ssl` option.                                                                                                                                                 |
    47  | `CONSUL_TLS_SERVER_NAME`                                     | Specifies the server name to use as the SNI host for Consul communication. Will be automatically set if Consul is configured to use TLS and the task is in a group using bridge networking mode.                                                                                                                     |