image Ref: https://github.com/minio/directpv?tab=readme-ov-file

DirectPV is designed to be lightweight and scalable to tens of thousands of drives. It is made up of three components - Controller, Node Driver, UI.

image

Ref: https://blog.min.io/introducing-directpv/ and https://www.min.io/directpv

DirectPV is similar to LocalPV but dynamically provisioned.

Ref: https://blog.min.io/the-story-of-directpv/

How does it choose drives

image

image

Ref: https://docs.min.io/enterprise/minio-directpv/resource-management/scheduling/

DirectPV CSI driver architecture

DirectPV is implemented as per the CSI specification. It comes with the below components run as Pods in Kubernetes.

When DirectPV contains legacy volumes from DirectCSI (old name of Direct PV), the below additional components also run as Pods.

Controller

The Controller runs as Deployment Pods named controller, which are three replicas located in any Kubernetes nodes. In the three replicas, one instance is elected to serve requests. Each pod contains below running containers:

Controller server

Controller server runs as container controller in a controller Deployment Pod. It handles below requests:

Below is a workflow diagram

┌────────────┐                                               ┌────────────┐
│            │ Create Event ┌─────────────┐ CreateVolume API │            │   ┌────────────────────┐
│            │------------->│     CSI     │----------------->│            │-->│  DirectPVDrive CRD │
│ Persistent │ Delete Event │ Provisioner │ DeleteVolume API │            │   └────────────────────┘
│   Volume   │------------->│             │----------------->│ Controller │
│   Claim    │              └─────────────┘                  │   Server   │
│   (PVC)    │                                               │            │   ┌────────────────────┐
│            │ Update Event ┌─────────────┐ ExpandVolume API │            │-->│ DirectPVVolume CRD │
│            │------------->│ CSI Resizer │----------------->│            │   └────────────────────┘
│            │              └─────────────┘                  └────────────┘
└────────────┘

Node server

Node server runs as DaemonSet Pods named node-server in all or selected Kubernetes nodes. Each node server Pod runs on a node independently. Each pod contains below running containers:

Below is a workflow diagram

┌─────────┐                    ┌────────┐                 ┌──────────────────────────────────┐    ┌────────────────────┐
│         │  StageVolume RPC   │        │   StageVolume   │ * Create data directory          │    │                    │
│         │------------------->│        │---------------->│ * Set xfs quota                  │<-->│                    │
│         │                    │        │                 │ * Bind mount staging target path │    │                    │
│         │                    │        │                 └──────────────────────────────────┘    │                    │
│         │ PublishVolume RPC  │        │  PublishVolume  ┌──────────────────────────────────┐    │                    │
│         │------------------->│        │---------------->│ * Bind mount target path         │<-->│                    │
│ Kubelet │                    │  Node  │                 └──────────────────────────────────┘    │ DirectPVDrive CRD  │
│         │UnpublishVolume RPC │ Server │ UnpublishVolume ┌──────────────────────────────────┐    │ DirectPVVolume CRD │
│         │------------------->│        │---------------->│ * Unmount target path            │<-->│                    │
│         │                    │        │                 └──────────────────────────────────┘    │                    │
│         │ UnstageVolume RPC  │        │  UnstageVolume  ┌──────────────────────────────────┐    │                    │
│         │------------------->│        │---------------->│ * Unmount staging target path    │<-->│                    │
│         │                    │        │                 └──────────────────────────────────┘    │                    │
│         │  ExpandVolume RPC  │        │   ExpandVolume  ┌──────────────────────────────────┐    │                    │
│         │------------------->│        │---------------->│ * Set xfs quota                  │<-->│                    │
└─────────┘                    └────────┘                 └──────────────────────────────────┘    └────────────────────┘

Ref: https://github.com/minio/directpv/blob/master/docs/architecture.md