Setup StorageClass
The parameters of IOMesh storage class are:
Parameter | Value | Default | Description |
---|---|---|---|
csi.storage.k8s.io/fstype | "xfs", "ext2", "ext3", "ext4" | "ext4" | volume File system type |
replicaFactor | "2", "3" | "2" | replica factor |
thinProvision | "true", "false" | "true" | thin provision or thick provision. |
After IOMesh CSI driver was installed, a default StorageClass iomesh-csi-driver
would be created. You may also create a new StorageClass with customized parameters:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: iomesh-csi-driver-default
provisioner: com.iomesh.csi-driver # <-- driver.name in iomesh-values.yaml
reclaimPolicy: Retain
allowVolumeExpansion: true
parameters:
# "ext4" / "ext3" / "ext2" / "xfs"
csi.storage.k8s.io/fstype: "ext4"
# "2" / "3"
replicaFactor: "2"
# "true" / "false"
thinProvision: "true"
volumeBindingMode: Immediate
About the
reclaimPolicy
The
reclaimPolicy
attribute ofStorageClass
can have two values ofRetain
andDelete
, and the default isDelete
. When aPV
is created throughStorageClass
, itspersistentVolumeReclaimPolicy
attribute will inherit thereclaimpolicy
attribute fromStorageClass
. You can also modify the value ofpersistentVolumeReclaimPolicy
manually.The value of
reclaimPolicy
in the example isRetain
, which means that, if you delete aPVC
, thePV
under thePVC
will not be deleted, but will enter theReleased
state. Please note that, if you delete thePV
, the corresponding IOMesh volume will not be deleted, instead, you need to change the value ofpersistentVolumeReclaimPolicy
of thePV
toDelete
and then delete thePV
. Or before creating aPV
, you can set the value ofreclaimpolicy
ofStorageClass
toDelete
so that all the resources will be released in cascade.