Enable XFS Quota on LocalPV Hostpath
This document provides the necessary steps to enable and configure XFS Quota on OpenEBS LocalPV HostPath. By following these instructions, you will install the OpenEBS LocalPV provisioner, create a StorageClass with XFS Quota support, and set up a PersistentVolumeClaim (PVC) to apply project quotas on the local volumes. It also includes the process for mounting the volume to an application pod and verifying that the quota is successfully applied.
#
Install the OpenEBS Dynamic LocalPV ProvisionerRefer to the OpenEBS Installation documentation to install the OpenEBS LocalPV Hostpath Provisioner.
#
Create StorageClass- To create a hostpath StorageClass with the XFSQuota configuration option, use the following YAML definition. This configuration will enable the XFSQuota for the specified path and storage type.
- For advanced configuration of XFSQuota, you may also set the
softLimitGrace
andhardLimitGrace
parameters, which define the storage capacity limits beyond the Persistent Volume (PV) storage request. The updated YAML definition is as follows:
note
softLimitGrace
andhardLimitGrace
are used in conjunction with the PV storage request to determine the soft and hard limits of the quota.The size of these limits is calculated as "Size of PV storage request * (1 + LimitGrace%)"
If no values are specified, the default is softLimitGrace: "0%" / hardLimitGrace: "0%", meaning the storage capacity is limited to the PV storage request value.
For example, with a PV of 100Gi capacity and values softLimitGrace: "90%" / hardLimitGrace: "100%", the soft limit will be set to 190Gi, and the hard limit will be set to 200Gi. You can select to use either
softLimitGrace
orhardLimitGrace
independently based on your requirements.Refer to the relevant xfs_quota documentation for more detailed instructions regarding the configuration of soft and hard limits.
#
Create a PVC- To create a PVC using the StorageClass's name, use the following definition:
At this stage, the PVC will remain in the 'Pending' state until the volume is successfully mounted.
- Verify the PVC status.
Example Output
#
Mount the Volume- Mount the volume to the application pod container. A sample BusyBox Pod template is as follows:
The PVC status will change to 'Bound' once the volume is successfully mounted and the quota will be applied.
- Verify that the XFS project quota is applied.
Example Output
#
LimitationResizing of quota is not supported.