Nomad
capability Block
Placement | volume -> capability |
The capability
block allows validating that a volume meets the requested
capabilities.
id = "ebs_prod_db1"
namespace = "default"
name = "database"
type = "csi"
plugin_id = "ebs-prod"
capacity_max = "200G"
capacity_min = "100G"
capability {
access_mode = "single-node-reader-only"
attachment_mode = "file-system"
}
You must provide at least one capability
block, and you must provide a block
for each capability you intend to use in a job's volume
block.
capability
Parameters
access_mode
(string)
- Defines whether a volume should be available concurrently. Theaccess_mode
andattachment_mode
from the volume request must exactly match one of the volume'scapability
blocks.For CSI volumes the
access_mode
is required. Can be one of the following:"single-node-reader-only"
"single-node-writer"
"multi-node-reader-only"
"multi-node-single-writer"
"multi-node-multi-writer"
Most CSI plugins support only single-node modes. Consult the documentation of the storage provider and CSI plugin.
For dynamic host volumes the
access_mode
is optional. Can be one of the following:In the job specification, the default is
single-node-writer
unlessread_only = true
, which translates tosingle-node-reader-only
.
attachment_mode
(string)
- The storage API used by the volume. One of"file-system"
or"block-device"
. Theaccess_mode
andattachment_mode
from the volume request must exactly match one of the volume'scapability
blocks.For CSI volumes the
attachment_mode
field is required. Most storage providers support"file-system"
, to mount volumes using the CSI filesystem API. Some storage providers support"block-device"
, which mounts the volume with the CSI block device API within the container.For dynamic host volumes the
attachment_mode
field is optional and defaults to"file-system"
.
capability
Examples
The following examples only show the capability
blocks. Remember that the
capability
block is only valid in the placement shown above.
Multiple capabilities
This examples shows a volume that must satisfy multiple capability requirements.
capability {
access_mode = "single-node-reader-only"
attachment_mode = "file-system"
}
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}