DirectPV is a CSI driver for dynamically provisioning direct persistent volumes.
Modern distributed datastores such as MinIO, Elastic, Cassandra, and MongoDB are designed to for locally attached drives (Local PV). These data services handle high availability and data durability by themselves. Running them on traditional SAN or NAS based CSI drivers (Network PV) adds yet another layer of replication/erasure coding and extra network hops in the datapath. This additional layer of disaggregation results in increased-complexity and poor performance.
Historically, these datastores relied on Kubernetes-provided HostPath and LocalPV for using locally attached drives. Local and Host Path Volume drivers are manual, static and ephemeral, introducing management complexity.
Here is the extremely quickstart:
kubectl krew install directpv
kubectl directpv install
kubectl directpv drives ls
# choose all the drives that directpv should manage and format them
kubectl directpv drives format --drives $DRIVE_SELECTOR_ELLIPSES --nodes $NODE_SELECTOR_ELLIPSES
# 'directpv-min-io' can now be specified as the storageclass in PodSpec.VolumeClaimTemplates
For more information, please visit our documentation.
LocalVolume provisioner also allows direct access to the storage medium. However, it requires manual management of drives and volumes - i.e. it does not support dynamic provisioning of volumes, storage management or dynamic scheduling of pods on nodes with available volumes.
DirectPV on the other hand, supports dynamic provisioning of volumes, performs allocation of volumes based on storage capacity, and schedules pods to run on nodes which have most capacity available.
HostPath volume also allows direct access to the storage medium. However, it only supports ephemeral volumes. i.e. pod scheduling is not tied to volume provisioning. Therefore, if a pod is rescheduled or restarted, it might end up on a node where the data is not available. However, since HostPath volumes are ephemeral, pod startup will go on without raising any errors.
HostPath volumes cannot be provisioned and managed via PVC resources. It is always provisioned either manually as a PV or directly specified in the PodSpec.
The high consistency and performance benefits of DirectPV come with the limitation that once provisioned, volumes cannot be moved to other nodes i.e. volumes are sticky to nodes.
Use of directpv
driver is governed by the GNU AGPLv3 license that can be found in the LICENSE file.
Important: Report security issues to [email protected]. Please do not report security issues here.