Deploy an Application
This section explains the instructions to deploy an application for the OpenEBS Local Persistent Volumes (PV) backed by LVM Storage.
Create the deployment yaml using the PVC backed by LVM storage.
After the deployment of the application, we can go to the node and see that the LVM volume is being used by the application for reading/writing the data and space is consumed from the LVM.
note
Check the provisioned volumes on the node, we need to run pvscan --cache command to update the LVM cache and then we can use lvdisplay and all other LVM commands on the node.
#
PersistentVolumeClaim Conformance MatrixThe following matrix shows supported PersistentVolumeClaim parameters for localpv-lvm.
Parameter | Values | Development Status | E2E Coverage Status |
---|---|---|---|
AccessMode | ReadWriteOnce | Supported | Yes |
| Not Supported | ||
| Not Supported | ||
Storageclass | StorageClassName | Supported | Yes |
Capacity Resource | Number along with size unit | Supported | Yes |
VolumeMode | Block | Supported | Yes Test cases available for Filesystem mode |
Filesystem | Supported | ||
Selectors | Equality & Set based selections | Supported | Pending |
VolumeName | Available PV name | Supported | Pending |
DataSource | - | Not Supported | Pending |
#
PersistentVolumeClaim ParametersAccessMode
LVM-LocalPV supports only ReadWriteOnce access mode i.e. volume can be mounted as read-write by a single node. AccessMode is a required field, if the field is unspecified then it will lead to a creation error. See here for more information about the access modes workflow.
StorageClassName
LVM CSI-Driver supports dynamic provision of volume for the PVCs referred to as LVM storageclass. StorageClassName is a required field, if the field is unspecified then it will lead to provision error. See here for more information about the dynamic provisioning workflow.
Capacity Resource
Admin/User can specify the desired capacity for LVM volume. CSI-Driver will provision a volume if the underlying volume group has requested capacity available else provisioning volume will be errored. StorageClassName is a required field, if the field is unspecified then it will lead to provisioning errors. See here for more information about the workflows.
VolumeMode (Optional)
Local PV LVM supports two kinds of volume modes (Defaults to Filesystem mode):
Block (Block mode can be used in a case where the application itself maintains filesystem) Filesystem (Application which requires filesystem as a prerequisite)
note
If unspecified defaults to Filesystem mode. See here for more information about workflows.
Selectors (Optional)
Users can bind any of the retained LVM volumes to the new PersistentVolumeClaim object via the selector field. If the selector and volumeName fields are unspecified then the LVM CSI driver will provision new volume. If the volume selector is specified then request will not reach to local pv driver. This is a use case of pre-provisioned volume. See here for more information about the workflows.
Follow the below steps to specify selector on PersistentVolumeClaim:
- List the PersistentVolumes(PVs) which has status Released.
note
If labels do not exist for persistent volume then it is required to add labels to PV.
- Remove the claimRef on selected persistentvolumes using patch command. (This will mark PV as Available for binding).
- Create PVC with the selector.
- Verify bound status of PV.
VolumeName (Optional)
VolumeName can be used to bind PersistentVolumeClaim(PVC) to retained PersistentVolume(PV). When VolumeName is specified K8s will ignore selector field. If volumeName field is specified Kubernetes will try to bind to specified volume(It will help to create claims for pre provisioned volume). If volumeName is unspecified then CSI driver will try to provision new volume. See here for more information about the workflows.
note
Before creating PVC make retained/preprovisioned PersistentVolume Available by removing claimRef on PersistentVolume.
#
DeprovisioningTo deprovision the volume we can delete the application that is using the volume and then we can go ahead and delete the PV, as part of the deletion of PV this volume will also be deleted from the volume group and data will be freed.
#
LimitationResize of volumes with snapshot is not supported.
#
SupportIf you encounter issues or have a question, file a Github issue, or talk to us on the #openebs channel on the Kubernetes Slack server.