github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/job-specification/volume.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: volume Stanza - Job Specification
     4  sidebar_title: volume
     5  description: >-
     6    The "volume" stanza allows the group to specify that it requires a given
     7    volume from the cluster. Nomad will automatically handle ensuring that the
     8    volume is available and mounted into the task.
     9  ---
    10  
    11  # `volume` Stanza
    12  
    13  <Placement groups={['job', 'group', 'volume']} />
    14  
    15  The `volume` stanza allows the group to specify that it requires a
    16  given volume from the cluster.
    17  
    18  The key of the stanza is the name of the volume as it will be exposed
    19  to task configuration.
    20  
    21  ```hcl
    22  job "docs" {
    23    group "example" {
    24      volume "certs" {
    25        type      = "host"
    26        source    = "ca-certificates"
    27        read_only = true
    28      }
    29    }
    30  }
    31  ```
    32  
    33  The Nomad server will ensure that the allocations are only scheduled
    34  on hosts that have a set of volumes that meet the criteria specified
    35  in the `volume` stanzas. These may be [host volumes][host_volume]
    36  configured on the client, or [CSI volumes][csi_volume] dynamically
    37  mounted by [CSI plugins][csi_plugin].
    38  
    39  The Nomad client will make the volumes available to tasks according to
    40  the [volume_mount][volume_mount] stanza in the `task` configuration.
    41  
    42  ## `volume` Parameters
    43  
    44  - `type` `(string: "")` - Specifies the type of a given volume. The
    45    valid volume types are `"host"` and `"csi"`.
    46  
    47  - `source` `(string: <required>)` - The name of the volume to
    48    request. When using `host_volume`'s this should match the published
    49    name of the host volume. When using `csi` volumes, this should match
    50    the ID of the registered volume.
    51  
    52  - `read_only` `(bool: false)` - Specifies that the group only requires
    53    read only access to a volume and is used as the default value for
    54    the `volume_mount -> read_only` configuration. This value is also
    55    used for validating `host_volume` ACLs and for scheduling when a
    56    matching `host_volume` requires `read_only` usage.
    57  
    58  [volume_mount]: /docs/job-specification/volume_mount 'Nomad volume_mount Job Specification'
    59  [host_volume]: /docs/configuration/client/#host_volume-stanza
    60  [csi_volume]: /docs/commands/volume/register
    61  [csi_plugin]: /docs/job-specification/csi_plugin