-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dynamic host volumes: add -type flag to volume init (#24667)
Adds a `-type` flag to the `volume init` command that generates an example volume specification with only those fields relevant to dynamic host volumes. This changeset also moves the string literals into uses of `go:embed` Ref: #24479
- Loading branch information
Showing
6 changed files
with
230 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
id = "ebs_prod_db1" | ||
namespace = "default" | ||
name = "database" | ||
type = "csi" | ||
plugin_id = "plugin_id" | ||
|
||
# For 'nomad volume register', provide the external ID from the storage | ||
# provider. This field should be omitted when creating a volume with | ||
# 'nomad volume create' | ||
external_id = "vol-23452345" | ||
|
||
# For 'nomad volume create', specify a snapshot ID or volume to clone. You can | ||
# specify only one of these two fields. | ||
snapshot_id = "snap-12345" | ||
# clone_id = "vol-abcdef" | ||
|
||
# Optional: for 'nomad volume create', specify a maximum and minimum capacity. | ||
# Registering an existing volume will record but ignore these fields. | ||
capacity_min = "10GiB" | ||
capacity_max = "20G" | ||
|
||
# Required (at least one): for 'nomad volume create', specify one or more | ||
# capabilities to validate. Registering an existing volume will record but | ||
# ignore these fields. | ||
capability { | ||
access_mode = "single-node-writer" | ||
attachment_mode = "file-system" | ||
} | ||
|
||
capability { | ||
access_mode = "single-node-reader" | ||
attachment_mode = "block-device" | ||
} | ||
|
||
# Optional: for 'nomad volume create', specify mount options to validate for | ||
# 'attachment_mode = "file-system". Registering an existing volume will record | ||
# but ignore these fields. | ||
mount_options { | ||
fs_type = "ext4" | ||
mount_flags = ["ro"] | ||
} | ||
|
||
# Optional: specify one or more locations where the volume must be accessible | ||
# from. Refer to the plugin documentation for what segment values are supported. | ||
topology_request { | ||
preferred { | ||
topology { segments { rack = "R1" } } | ||
} | ||
required { | ||
topology { segments { rack = "R1" } } | ||
topology { segments { rack = "R2", zone = "us-east-1a" } } | ||
} | ||
} | ||
|
||
# Optional: provide any secrets specified by the plugin. | ||
secrets { | ||
example_secret = "xyzzy" | ||
} | ||
|
||
# Optional: provide a map of keys to string values expected by the plugin. | ||
parameters { | ||
skuname = "Premium_LRS" | ||
} | ||
|
||
# Optional: for 'nomad volume register', provide a map of keys to string | ||
# values expected by the plugin. This field will populated automatically by | ||
# 'nomad volume create'. | ||
context { | ||
endpoint = "http://192.168.1.101:9425" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"id": "ebs_prod_db1", | ||
"namespace": "default", | ||
"name": "database", | ||
"type": "csi", | ||
"plugin_id": "plugin_id", | ||
"external_id": "vol-23452345", | ||
"snapshot_id": "snap-12345", | ||
"capacity_min": "10GiB", | ||
"capacity_max": "20G", | ||
"capability": [ | ||
{ | ||
"access_mode": "single-node-writer", | ||
"attachment_mode": "file-system" | ||
}, | ||
{ | ||
"access_mode": "single-node-reader", | ||
"attachment_mode": "block-device" | ||
} | ||
], | ||
"context": [ | ||
{ | ||
"endpoint": "http://192.168.1.101:9425" | ||
} | ||
], | ||
"mount_options": [ | ||
{ | ||
"fs_type": "ext4", | ||
"mount_flags": [ | ||
"ro" | ||
] | ||
} | ||
], | ||
"topology_request": { | ||
"preferred": [ | ||
{ | ||
"topology": { | ||
"segments": { | ||
"rack": "R1" | ||
} | ||
} | ||
} | ||
], | ||
"required": [ | ||
{ | ||
"topology": { | ||
"segments": { | ||
"rack": "R1" | ||
} | ||
} | ||
}, | ||
{ | ||
"topology": { | ||
"segments": { | ||
"rack": "R2", | ||
"zone": "us-east-1a" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"parameters": [ | ||
{ | ||
"skuname": "Premium_LRS" | ||
} | ||
], | ||
"secrets": [ | ||
{ | ||
"example_secret": "xyzzy" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
id = "disk_prod_db1" | ||
namespace = "default" | ||
name = "database" | ||
type = "host" | ||
plugin_id = "plugin_id" | ||
|
||
# Optional: for 'nomad volume create', specify a maximum and minimum capacity. | ||
# Registering an existing volume will record but ignore these fields. | ||
capacity_min = "10GiB" | ||
capacity_max = "20G" | ||
|
||
# Required (at least one): for 'nomad volume create', specify one or more | ||
# capabilities to validate. Registering an existing volume will record but | ||
# ignore these fields. | ||
capability { | ||
access_mode = "single-node-writer" | ||
attachment_mode = "file-system" | ||
} | ||
|
||
capability { | ||
access_mode = "single-node-reader" | ||
attachment_mode = "block-device" | ||
} | ||
|
||
# Optional: provide a map of keys to string values expected by the plugin. | ||
parameters { | ||
skuname = "Premium_LRS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"id": "disk_prod_db1", | ||
"namespace": "default", | ||
"name": "database", | ||
"type": "host", | ||
"plugin_id": "plugin_id", | ||
"capacity_min": "10GiB", | ||
"capacity_max": "20G", | ||
"capability": [ | ||
{ | ||
"access_mode": "single-node-writer", | ||
"attachment_mode": "file-system" | ||
}, | ||
{ | ||
"access_mode": "single-node-reader", | ||
"attachment_mode": "block-device" | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"skuname": "Premium_LRS" | ||
} | ||
] | ||
} |
Oops, something went wrong.