Skip to content

Commit

Permalink
docs: updates for CSI topology
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 25, 2022
1 parent 4b85d75 commit e9c43b4
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
54 changes: 54 additions & 0 deletions website/content/docs/commands/volume/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ mount_options {
mount_flags = ["noatime"]
}
topology_request {
required {
topology { segments { "rack" = "R2" } }
topology { segments { "rack" = "R1", "zone" = "us-east-1a"} }
}
preferred {
topology { segments { "rack" = "R1", "zone" = "us-east-1a"} }
}
}
secrets {
example_secret = "xyzzy"
}
Expand Down Expand Up @@ -134,6 +144,16 @@ parameters {
- `mount_flags` `([]string: <optional>)` - The flags passed to `mount`
(ex. `["ro", "noatime"]`)

- `topology_request`
<code>([TopologyRequest](#topology_request-parameters):
<optional>)</code> - Specify locations (region, zone, rack, etc.)
where the provisioned volume must be accessible from. Consult the
documentation for your storage provider and CSI plugin as to whether
it supports defining topology and what values it expects for
topology segments. Specifying topology segments that aren't
supported by the storage provider may return an error or may be
silently removed by the plugin.

- `secrets` <code>(map<string|string>:nil)</code> - An optional
key-value map of strings used as credentials for publishing and
unpublishing volumes.
Expand All @@ -144,6 +164,40 @@ parameters {
to each storage provider, so please see the specific plugin
documentation for more information.

### `topology_request` Parameters

For the `topology_request` field, you may specify a list of either
`required` or `preferred` topologies (or both). The `required`
topologies indicate that the volume must be created in a location
accessible from at least one of the listed topologies. The `preferred`
topologies indicate that you would prefer the storage provider to
create the volume in one of the provided topologies.

Each topology listed has a single field:

- `segments` `(map[string]string)` - A map of location types to their
values. The specific fields required are defined by the CSI
plugin. For example, a plugin might require defining both a rack and
a zone: `segments {rack = "R2", zone = "us-east-1a"}`.

For example:

```hcl
topology_request {
required {
topology { segments { "rack" = "R1", "zone" = "us-east-1a" } }
topology { segments { "rack" = "R2", "zone" = "us-east-1a" } }
}
preferred {
topology { segments { "rack" = "R1", "zone" = "us-east-1a"} }
}
}
```

This configuration indicates you require the volume to be created
within racks `R1` or `R2`, but that you prefer the volume to be
created within `R1`.

### Unused Fields

Note that several fields used in the [`volume register`] command are set
Expand Down
49 changes: 49 additions & 0 deletions website/content/docs/commands/volume/register.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ mount_options {
mount_flags = ["noatime"]
}
topology_request {
required {
topology { segments { "rack" = "R2" } }
topology { segments { "rack" = "R1", "zone" = "us-east-1a"} }
}
}
secrets {
example_secret = "xyzzy"
}
Expand Down Expand Up @@ -120,6 +127,16 @@ context {
- `fs_type`: file system type (ex. `"ext4"`)
- `mount_flags`: the flags passed to `mount` (ex. `"ro,noatime"`)

- `topology_request`
<code>([TopologyRequest](#topology_request-parameters):
<optional>)</code> - Specify locations (region, zone, rack, etc.)
where the provisioned volume is accessible from. Consult the
documentation for your storage provider and CSI plugin as to whether
it supports defining topology and what values it expects for
topology segments. Specifying topology segments that aren't
supported by the storage provider may return an error or may be
silently removed by the plugin.

- `secrets` <code>(map<string|string>:nil)</code> - An optional
key-value map of strings used as credentials for publishing and
unpublishing volumes.
Expand All @@ -136,6 +153,38 @@ context {
each storage provider, so please see the specific plugin
documentation for more information.

### `topology_request` Parameters

For the `topology_request` field, you may specify a list of `required`
topologies. The `required` topologies indicate that the volume was
created in a location accessible from all the listed topologies.

Note this behavior is different from the `nomad volume create`
command, because the volume has already been created and you are
defining the topology for Nomad. The `register` command does not
support setting `preferred` topologies.

Each topology listed has a single field:

- `segments` `(map[string]string)` - A map of location types to their
values. The specific fields required are defined by the CSI
plugin. For example, a plugin might require defining both a rack and
a zone: `segments {rack = "R2", zone = "us-east-1a"}`.

For example:

```hcl
topology_request {
required {
topology { segments { "rack" = "R1", "zone" = "us-east-1a" } }
topology { segments { "rack" = "R2", "zone" = "us-east-1a" } }
}
}
```

This configuration indicates that the volume is accessible from both
racks `R1` or `R2`.

### Unused Fields

Note that several fields used in the [`volume create`] command are set
Expand Down

0 comments on commit e9c43b4

Please sign in to comment.