Skip to main content

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 and LVM-specific parameters, their development status, E2E test coverage, 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#

Parameter Values Development Status E2E Coverage
allowVolumeExpansion true Supported Yes
(Test coverage exist for ext4 & xfs)
false Supported
MountOptions Options supported by filesystem Supported Pending
VolumeBindingMode Immediate Supported Yes
WaitForFirstConsumer Supported
Reclaim Policy Retain Supported Yes
(Test coverage exist for Delete reclaim policy)
Delete Supported
allowedTopologies - Supported Yes
Parameters Passing Secrets No Use Case NA
fsType ext2 Supported Yes
(Test coverage exist for ext4 & xfs)
ext3
ext4
xfs
btrfs

LVM Supported StorageClass Parameters#

Parameter Values Development Status E2E Coverage
Parameters shared yes Supported Yes
vgpattern Regular expression of volume group name Supported Yes
volgroup Name of volume group Supported Yes
thinProvision yes Supported Yes
scheduler SpaceWeighted or CapacityWeighted or VolumeWeighted Supported Pending

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#

Was this page helpful? We appreciate your feedback