6598567725
In addition to jobs, there are other objects in Nomad that have a specific format and can be provided to commands and API endpoints. This commit creates a new menu section to hold the specification for volumes and update the command pages to point to the new centralized definition. Redirecting the previous entries is not possible with `redirect.js` because they are done server-side and URL fragments are not accessible to detect a match. So we provide hidden anchors with a link to the new page to guide users towards the new documentation. Co-authored-by: Tim Gross <tgross@hashicorp.com>
74 lines
2 KiB
Plaintext
74 lines
2 KiB
Plaintext
---
|
|
layout: docs
|
|
page_title: capability Block - Volume Specification
|
|
description: The "capability" block allows for validating the capability of a volume.
|
|
---
|
|
|
|
# `capability` Block
|
|
|
|
<Placement
|
|
groups={[
|
|
['volume', 'capability'],
|
|
]}
|
|
/>
|
|
|
|
The `capability` block allows validating that a volume meets the requested
|
|
capabilities.
|
|
|
|
```hcl
|
|
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: <required>)` - Defines whether a volume should be
|
|
available concurrently. Can be one of `"single-node-reader-only"`,
|
|
`"single-node-writer"`, `"multi-node-reader-only"`,
|
|
`"multi-node-single-writer"`, or `"multi-node-multi-writer"`. Most CSI plugins
|
|
support only single-node modes. Consult the documentation of the storage
|
|
provider and CSI plugin.
|
|
|
|
- `attachment_mode` `(string: <required>)` - The storage API that will be used
|
|
by the volume. Most storage providers will support `"file-system"`, to mount
|
|
volumes using the CSI filesystem API. Some storage providers will support
|
|
`"block-device"`, which will mount the volume with the CSI block device API
|
|
within the container.
|
|
|
|
## `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.
|
|
|
|
```hcl
|
|
capability {
|
|
access_mode = "single-node-reader-only"
|
|
attachment_mode = "file-system"
|
|
}
|
|
|
|
capability {
|
|
access_mode = "single-node-writer"
|
|
attachment_mode = "file-system"
|
|
}
|
|
```
|
|
|
|
[`volume`]: /docs/job-specification/volume
|