Skip to main content
Version: main

Create StorageClass(s)

This document provides step-by-step instructions on creating a custom StorageClass for Local PV LVM, including detailed explanations of supported parameters and their usage. It covers standard LVM-specific parameters and how to configure scheduling logic like SpaceWeighted, CapacityWeighted, or VolumeWeighted.

$ cat sc.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmpv
parameters:
storage: "lvm"
volgroup: "lvmvg"
provisioner: local.csi.openebs.io

Refer Storage Classes to know all the supported parameters for Local PV LVM.

StorageClass Parameters Conformance Matrix

The following matrix shows standard StorageClass parameters for Local PV LVM.

Standard StorageClass Parameters

ParameterValues
allowVolumeExpansiontrue / false
MountOptionsFilesystem-supported mount options
VolumeBindingModeImmediate / WaitForFirstConsumer
Reclaim PolicyRetain/ Delete
allowedTopologies-
fsTypeext2, ext3, ext4, xfs and btrfs

LVM Supported StorageClass Parameters

ParameterValues
sharedyes
vgpatternRegular expression of the volume group name
volgroupVolume group name
thinProvisionyes
schedulerSpaceWeighted, CapacityWeighted, VolumeWeighted

StorageClass with Scheduler Parameters

The Local PV LVM Driver supports three types of scheduling logic: SpaceWeighted, VolumeWeighted, and CapacityWeighted (Supported from lvm-driver: v0.9.0).

Add the scheduler parameter in storage class and give its value accordingly.

parameters:
storage: "lvm"
volgroup: "lvmvg"
scheduler: "CapacityWeighted" ## or "VolumeWeighted"
  • SpaceWeighted is the default scheduler in the Local PV LVM driver, so even if we do not use the scheduler parameter in storageclass, the driver will pick the node where there is a vg with the highest free space adhering to the volgroup/vgpattern parameter.

  • If CapacityWeighted scheduler is used, then the driver will pick the node containing vg that has the least allocated storage in terms of capacity.

  • If VolumeWeighted scheduler is used, then the driver will pick the node containing vg (adhering to vgpattern/volgroup parameter) that has the least number of volumes provisioned on it.

Support

If you encounter issues or have a question, file a Github issue, or talk to us on the #openebs channel on the Kubernetes Slack server.

See Also