Nomad
volume Stanza
| Placement | job -> group -> volume |
The volume stanza allows the group to specify that it requires a
given volume from the cluster.
The key of the stanza is the name of the volume as it will be exposed to task configuration.
job "docs" {
group "example" {
volume "certs" {
type = "host"
source = "ca-certificates"
read_only = true
}
}
}
The Nomad server will ensure that the allocations are only scheduled
on hosts that have a set of volumes that meet the criteria specified
in the volume stanzas. These may be host volumes
configured on the client, or CSI volumes dynamically
mounted by CSI plugins.
The Nomad client will make the volumes available to tasks according to
the volume_mount stanza in the task configuration.
volume Parameters
type(string: "")- Specifies the type of a given volume. The valid volume types are"host"and"csi".source(string: <required>)- The name of the volume to request. When usinghost_volume's this should match the published name of the host volume. When usingcsivolumes, this should match the ID of the registered volume.read_only(bool: false)- Specifies that the group only requires read only access to a volume and is used as the default value for thevolume_mount -> read_onlyconfiguration. This value is also used for validatinghost_volumeACLs and for scheduling when a matchinghost_volumerequiresread_onlyusage.