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
reclaimPolicyThe
reclaimPolicyattribute ofStorageClasscan have two values ofRetainandDelete, and the default isDelete. When aPVis created throughStorageClass, itspersistentVolumeReclaimPolicyattribute will inherit thereclaimpolicyattribute fromStorageClass. You can also modify the value ofpersistentVolumeReclaimPolicymanually.The value of
reclaimPolicyin the example isRetain, which means that, if you delete aPVC, thePVunder thePVCwill not be deleted, but will enter theReleasedstate. Please note that, if you delete thePV, the corresponding IOMesh volume will not be deleted, instead, you need to change the value ofpersistentVolumeReclaimPolicyof thePVtoDeleteand then delete thePV. Or before creating aPV, you can set the value ofreclaimpolicyofStorageClasstoDeleteso that all the resources will be released in cascade.