In Kubernetes, a StorageClass
provides a way for administrators to describe the “classes” of storage they offer.
For NVMesh, different StorageClasses could describe different type of volumes that will be created by the NVMesh backend. (e.g different RAID Levels).
Let’s look at an example of a StorageClass yaml and then describe the fields relevant to NVMesh and their options.
For more information on StorageClass, see K8s Docs – StorageClass.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: nvmesh-raid10
provisioner: nvmesh-csi.excelero.com
allowVolumeExpansion: true
volumeBindingMode: Immediate
mountOptions:
- debug
parameters:
vpg: DEFAULT_RAID_10_VPG
Provisioner
The provisioner
field determines which storage backend driver / plugin will be used for provisioning the volume.
To create an NVMesh volume, this field must be set to: nvmesh-csi.excelero.com
Allow Volume Expansion (allowVolumeExpansion)
The field allowVolumeExpansion
controls whether the volume should be expandable or not.
For more info, see K8s Docs – Allow Volume Expansion.
Volume Binding Mode (volumeBindingMode)
The volumeBindingMode
field controls volume provisioning timing. The following values are accepted:
Immediate
: This is the default if omitted. If this value is set, dynamic provisioning occurs once the PersistentVolumeClaim is created.WaitForFirstConsumer
: If this value is set, volume provisioning will be delayed until a Pod using the PersistentVolumeClaim is created.
For more info on volumeBindingMode, see K8s Docs – VolumeBindingMode
Mount Options (mountOptions)
The mountOptions
field enables setting the options passed to the mount command (mount -o <options>
) and a special key allows to set the mount permissions.
To set the mount permissions, for example to 777, use:
mountOptions:
- nvmesh:permissions=777
Parameters
The parameters
field is a structure used to define NVMesh specific parameters. The following parameters are accepted:
field name | type | description |
---|---|---|
fsType Deprecated |
choice ext4,xfs | Deprecated, see csi.storage.k8s.io/fstype below |
csi.storage.k8s.io/fstype |
choice ext4,xfs | When a PVC has volumeMode: FileSystem , the fsType field will determine which FileSystem type will be deployed on the volume. Accepted values are: ext4 , xfs |
mkfsOptions |
string, optional | Flags and extended options to pass to mkfs command when creating a Filesystem. For available options, see the documentation of mkfs.ext4 or mkfs.xfs e.g: mkfsOption: -b 4096 |
vpg |
string, optional | The name of the NVMesh Volume Provisioning Group (VPG) as defined in the NVMesh Management. |
raidLevel |
string, optional | The volume type, allowed values are: concatenated , raid0 , raid1 , raid10 and ec . |
diskClasses |
list, optional | Limit volume allocation to specific diskClasses, defaults to None. |
serverClasses |
list, optional | Limit volume allocation to specific serverClasses, defaults to None. |
limitByDisks |
list, optional | Limit volume allocation to specific disks, defaults to None. |
limitByNodes |
list, optional | Limit volume allocation to specific nodes, defaults to None. |
encryption: dmcrypt |
string, optional | Provision encrypted volumes – must equal dmcrypt |
csi.storage.k8s.io/node-stage-secret-name |
string, optional | Encryption key Secret object name |
csi.storage.k8s.io/node-stage-secret-namespace |
string, optional | Encryption key Secret object namespace |
dmcrypt/type |
string, optional | select LUKS header type. |
dmcrypt/cipher |
string, optional | select encryption cipher. |
If raidLevel
is defined, the following parameters are accepted according to the selected raidLevel
:
- If raidLevel is
raid0
orraid10
stripeSize
(integer, optional) – number in blocks of 4k, i.e. stripeSize:32 = 128k, optional, defaults to 32.stripeWidth
(integer, optional) – number of disks to use, defaults to 2.
- If raidLevel is
ec
dataBlocks
(integer, optional) – number of disks to use, defaults to 8.parityBlocks
(integer, optional) – number of disks to use, defaults to 2.protectionLevel
(string, optional) – protection level to use, allowed values areFull Separation
,Minimal Separation
,Ignore Separation
defaults toFull Separation
.
Post your comment on this topic.