Volume Sets
Overview
A volume set is a collection of storage volumes, which are used by a stateful workload. A volume set provides a unique volume for each replica in the linked workload. Each volume set can be used by at most one stateful workload.
Sharing Data Between Replicas
Control Plane does not allow individual volumes in a set to be shared by multiple workload replicas, nor does Control Plane replicate data between volumes in a volume set. If you require data sharing or replication, this must be accomplished at the application level (e.g. by using WAL streaming between two Postgresql instances)
Capacity and Billing
- When a volume is created, it will have an initial capacity defined by the spec of your volume set.
- Volume capacity can be increased by sending an
expandVolume
command. - Volume capacity cannot be decreased.
- The bill for a volume set is calculated by summing the reserved GB of all volumes.
Autoscaling
- Like workloads, volume sets scale horizontally. Every replica in the linked workload is automatically assigned a volume.
- When the linked workload scales down, the volumes are preserved. Volumes are only deleted when you send a
deleteVolume
command, or when the volume set itself is deleted.
Automatic Expansion
The spec.autoscaling
object allows you to specify rules for automatically expanding volumes in the set. The available options are:
maxCapacity
: The largest allowable size for any volume in the set.minFreePercentage
: This must be a number between 1 and 100. When the free percentage on any volume drops below this threshold, Control Plane will issue anexpandVolume
command automatically.scalingFactor
: This must be a number 1. When a volume must be expanded, the new capacity will be (the minimum size to ensureminFreePercentage
)scalingFactor
. E.g. if a volume is using 8/10 GB, and theminFreePercentage
is 50, the new capacity will be 16scalingFactor
, assuming that product ismaxCapacity
.
For example:
Snapshots
Snapshots can be taken at any time and (optionally) on a regular schedule. To set up automatic snapshotting, you may use the spec.snapshots
object. Options include:
retentionDuration
: The length of time to retain a newly created snapshot. This should be a floating point number followed by either d, h, or m (for day, hour or minute)schedule
: A cron expression describing the snapshot frequency. Snapshots cannot be taken more frequently than once per hour.
File Systems
Each volume set has a single, immutable file system.
Currently supported file systems are:
- ext4
- xfs
Performance Classes
Each volume set has a single, immutable, performance class.
The performance class determines:
- How many Megabytes per second can be transferred to and from the volume (MB/second)
- How many I/O operations can be processed per second. (IOPS)
- Read/write latency
Volume performance varies widely by cloud service provider.
General-Purpose SSD
Name: general-purpose-ssd
Minimum Capacity: 10Gb
Maximum Capacity: 16384Gb
Service Provider | Max Throughput | Max IOPS |
---|---|---|
AWS | 125 MB/s | 3000 |
GCP | 1200 MB/s | 80000 |
Azure | 125 MB/s | 3000 |
High-Throughput SSD
high-throughput-ssd
Minimum Capacity: 200Gb
Maximum Capacity: 16384Gb
Service Provider | Max Throughput | Max IOPS |
---|---|---|
AWS | 400 MB/s | 4600 |
GCP | 1200 MB/s | 100000 |
Azure | 1200 MB/s | 15500 |
Commands
Volume sets support imperative operations on individual volumes and snapshots. To issue a command, send a POST
to the volume set’s -command
endpoint. e.g. POST https://api.cpln.io/org/my-org/gvc/my-gvc/volumeset/my-volume-set/-command
. These commands can also be created using the Control Plane console at https://console.cpln.io
Volume Expansion
Volumes can be expanded on-demand by issuing a expandVolume
command. If the volume set is in-use by a workload, the corresponding workload replica will be restarted.
expandVolume
Spec:
- location
- volumeIndex
- newStorageCapacity
For example:
Volume Deletion
To delete a volume, issue a deleteVolume
command.
deleteVolume
This command deletes the specified volume’s storage device. Note: the metadata for the volume at the specified index will not be removed from the volume set. Only your data will be deleted.
Deleting an in-use volume
If the volume set is in-use by a workload, a new storage device may be immediately created. e.g. if the volume set is in-use by a workload with one replica, and you delete the volume at index 0, Control Plane will:
- Create an empty volume to service the workload
- Delete the old volume as requested
- Restart the workload replica, binding it to the volume created in step 1.
For example:
Snapshots
Each volume in a set has its own list of snapshots. You manipulate snapshots by issuing commands to the volume set.
createVolumeSnapshot
Take a snapshot for a given volume (specified by location and volume index). snapshotName
must be unique for the target volume.
Spec:
- location
- volumeIndex
- snapshotName
- snapshotExpirationDate
- tags
- Specify any key/value pair here.
For example:
deleteVolumeSnapshot
Delete the specified snapshot.
Spec:
- location
- volumeIndex
- snapshotName
For example:
restoreVolume
Restore the specified volume to one of its snapshots. If this volume set is in-use by a workload, the corresponding workload replica will restart.
This operation creates an entirely new volume using the given snapshot. All unsaved data on the original volume will be lost.
Spec:
- location
- volumeIndex
- snapshotName
For example:
BYOK Support
Volume sets are supported in BYOK locations as long as the following prerequisites are met:
-
The cluster must have a CSI-compatible storage driver installed.
-
You must create storage classes which use the CSI-compatible provisioner, with the following names:
general-purpose-ssd-ext4
general-purpose-ssd-xfs
premium-low-latency-ssd-ext4
premium-low-latency-ssd-xfs
general-purpose-ssd-ext4-command
general-purpose-ssd-xfs-command
premium-low-latency-ssd-ext4-command
premium-low-latency-ssd-xfs-command
Planned Features
- Automatic volume expansion.
Permissions
The permissions below are used to define policies together with one or more of the four principal types:
Permission | Description | Implies |
---|---|---|
create | Create new volumesets | |
delete | Delete existing identities | |
edit | Modify existing identities | view |
exec | Execute commands | exec.restoreVolume, exec.createVolumeSnapshot, exec.expandVolume, exec.deleteVolume, exec.deleteVolumeSnapshot |
exec.createVolumeSnapshot | Create a snapshot of a volume | |
exec.deleteVolume | Delete a volume | |
exec.deleteVolumeSnapshot | Delete a volume snapshot | |
exec.expandVolume | Increase the storage capacity of a volume | |
exec.restoreVolume | Restore a volume to a snapshot | |
manage | Full access | create, delete, edit, exec, exec.createVolumeSnapshot, exec.deleteVolume, exec.deleteVolumeSnapshot, exec.expandVolume, exec.restoreVolume, manage, view |
view | Read-only access |
Access Report
Displays the permissions granted to principals for the volume set.
CLI
To view the CLI documentation for Volume Sets, click here.