github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/partials/envvars.mdx (about)

     1  <table>
     2    <thead>
     3      <tr>
     4        <th>Variable</th>
     5        <th>Description</th>
     6      </tr>
     7    </thead>
     8    <tbody>
     9      <tr>
    10        <td>
    11          <code>NOMAD_ALLOC_DIR</code>
    12        </td>
    13        <td>
    14          The path to the shared <code>alloc/</code> directory. See
    15          <a href="/docs/runtime/environment#task-directories">
    16            here for more
    17          </a> information.
    18        </td>
    19      </tr>
    20      <tr>
    21        <td>
    22          <code>NOMAD_TASK_DIR</code>
    23        </td>
    24        <td>
    25          The path to the task <code>local/</code> directory. See
    26          <a href="/docs/runtime/environment#task-directories">here</a> for more information.
    27        </td>
    28      </tr>
    29      <tr>
    30        <td>
    31          <code>NOMAD_SECRETS_DIR</code>
    32        </td>
    33        <td>
    34          Path to the task's secrets directory. See
    35          <a href="/docs/runtime/environment#task-directories">here</a> for more information.
    36        </td>
    37      </tr>
    38      <tr>
    39        <td>
    40          <code>NOMAD_MEMORY_LIMIT</code>
    41        </td>
    42        <td>Memory limit in MB for the task</td>
    43      </tr>
    44      <tr>
    45        <td>
    46          <code>NOMAD_CPU_LIMIT</code>
    47        </td>
    48        <td>CPU limit in MHz for the task</td>
    49      </tr>
    50      <tr>
    51        <td>
    52          <code>NOMAD_ALLOC_ID</code>
    53        </td>
    54        <td>Allocation ID of the task</td>
    55      </tr>
    56      <tr>
    57        <td>
    58          <code>NOMAD_ALLOC_NAME</code>
    59        </td>
    60        <td>Allocation name of the task</td>
    61      </tr>
    62      <tr>
    63        <td>
    64          <code>NOMAD_ALLOC_INDEX</code>
    65        </td>
    66        <td>
    67          Allocation index; useful to distinguish instances of task groups. From 0
    68          to (count - 1). The index is unique within a given version of a job, but
    69          canaries or failed tasks in a deployment may reuse the index.
    70        </td>
    71      </tr>
    72      <tr>
    73        <td>
    74          <code>NOMAD_TASK_NAME</code>
    75        </td>
    76        <td>Task's name</td>
    77      </tr>
    78      <tr>
    79        <td>
    80          <code>NOMAD_GROUP_NAME</code>
    81        </td>
    82        <td>Group's name</td>
    83      </tr>
    84      <tr>
    85        <td>
    86          <code>NOMAD_JOB_ID</code>
    87        </td>
    88        <td>
    89          Job's ID, which is equal to the Job name when submitted through
    90          CLI but can be different when using the API
    91        </td>
    92      </tr>
    93      <tr>
    94        <td>
    95          <code>NOMAD_JOB_NAME</code>
    96        </td>
    97        <td>Job's name</td>
    98      </tr>
    99      <tr>
   100        <td>
   101          <code>NOMAD_JOB_PARENT_ID</code>
   102        </td>
   103        <td>ID of the Job's parent if it has one</td>
   104      </tr>
   105      <tr>
   106        <td>
   107          <code>NOMAD_DC</code>
   108        </td>
   109        <td>Datacenter in which the allocation is running</td>
   110      </tr>
   111      <tr>
   112        <td>
   113          <code>NOMAD_NAMESPACE</code>
   114        </td>
   115        <td>Namespace in which the allocation is running</td>
   116      </tr>
   117      <tr>
   118        <td>
   119          <code>NOMAD_REGION</code>
   120        </td>
   121        <td>Region in which the allocation is running</td>
   122      </tr>
   123      <tr>
   124        <td>
   125          <code>NOMAD_META_&lt;key&gt;</code>
   126        </td>
   127        <td>
   128          The metadata value given by <code>key</code> on the task's
   129          metadata. Note that this is different from
   130          <a href="/docs/runtime/interpolation#node-variables-">
   131            <code>$&#123;meta.&lt;key&gt;&#125;</code>
   132          </a>
   133          which are keys in the node's metadata.
   134        </td>
   135      </tr>
   136      <tr>
   137        <td>
   138          <code>VAULT_TOKEN</code>
   139        </td>
   140        <td>
   141          The task's Vault token. See
   142          <a href="/docs/vault-integration">Vault Integration</a>
   143          for more details
   144        </td>
   145      </tr>
   146      <tr>
   147        <th colspan="2">Network-related Variables</th>
   148      </tr>
   149      <tr>
   150        <td>
   151          <code>NOMAD_IP_&lt;label&gt;</code>
   152        </td>
   153        <td>
   154          Host IP for the given port <code>label</code>. See
   155          <a href="/docs/job-specification/network">here for more</a> information.
   156        </td>
   157      </tr>
   158      <tr>
   159        <td>
   160          <code>NOMAD_PORT_&lt;label&gt;</code>
   161        </td>
   162        <td>
   163          Port for the given port <code>label</code>. Driver-specified port when a
   164          port map is used, otherwise the host's static or dynamic port
   165          allocation. Services should bind to this port. See
   166          <a href="/docs/job-specification/network">here for more</a> information.
   167        </td>
   168      </tr>
   169      <tr>
   170        <td>
   171          <code>NOMAD_ADDR_&lt;label&gt;</code>
   172        </td>
   173        <td>
   174          Host <code>IP:Port</code> pair for the given port <code>label</code>.
   175        </td>
   176      </tr>
   177      <tr>
   178        <td>
   179          <code>NOMAD_HOST_PORT_&lt;label&gt;</code>
   180        </td>
   181        <td>
   182          Port on the host for the port <code>label</code>. See
   183          <a href="/docs/job-specification/network#mapped-ports">here</a> for more
   184          information.
   185        </td>
   186      </tr>
   187      <tr>
   188        <td>
   189          <code>NOMAD_IP_&lt;task&gt;_&lt;label&gt;</code>
   190        </td>
   191        <td>
   192          Host IP for the given port <code>label</code> and <code>task</code> for
   193          tasks in the same task group.
   194        </td>
   195      </tr>
   196      <tr>
   197        <td>
   198          <code>NOMAD_PORT_&lt;task&gt;_&lt;label&gt;</code>
   199        </td>
   200        <td>
   201          Port for the given port <code>label</code> and <code>task</code> for
   202          tasks in the same task group. Driver-specified port when a port map is
   203          used, otherwise the host's static or dynamic port allocation.
   204          Services should bind to this port.
   205        </td>
   206      </tr>
   207      <tr>
   208        <td>
   209          <code>NOMAD_ADDR_&lt;task&gt;_&lt;label&gt;</code>
   210        </td>
   211        <td>
   212          Host <code>IP:Port</code> pair for the given port <code>label</code> and
   213          <code>task</code> for tasks in the same task group.
   214        </td>
   215      </tr>
   216      <tr>
   217        <td>
   218          <code>NOMAD_HOST_PORT_&lt;task&gt;_&lt;label&gt;</code>
   219        </td>
   220        <td>
   221          Port on the host for the port <code>label</code> and <code>task</code>
   222          for tasks in the same task group.
   223        </td>
   224      </tr>
   225      <tr>
   226        <td>
   227          <code>NOMAD_UPSTREAM_IP_&lt;service&gt;</code>
   228        </td>
   229        <td>
   230          IP for the given <code>service</code> when defined as a Consul Connect
   231          <a href="/docs/job-specification/upstreams">upstream</a>.
   232        </td>
   233      </tr>
   234      <tr>
   235        <td>
   236          <code>NOMAD_UPSTREAM_PORT_&lt;service&gt;</code>
   237        </td>
   238        <td>
   239          Port for the given <code>service</code> when defined as a Consul Connect
   240          <a href="/docs/job-specification/upstreams">upstream</a>.
   241        </td>
   242      </tr>
   243      <tr>
   244        <td>
   245          <code>NOMAD_UPSTREAM_ADDR_&lt;service&gt;</code>
   246        </td>
   247        <td>
   248          Host <code>IP:Port</code> for the given <code>service</code> when
   249          defined as a Consul Connect
   250          <a href="/docs/job-specification/upstreams">upstream</a>.
   251        </td>
   252      </tr>
   253      <tr>
   254        <td>
   255          <code>NOMAD_ENVOY_ADMIN_ADDR_&lt;service&gt;</code>
   256        </td>
   257        <td>
   258          Local address <code>localhost:Port</code> for the admin port of the
   259          envoy sidecar for the given <code>service</code> when defined as a
   260          Consul Connect enabled service.
   261        </td>
   262      </tr>
   263    </tbody>
   264  </table>