CRD Reference

This page documents the Custom Resource Definitions (CRDs) that DirectPV creates and manages.

Overview

DirectPV uses the following CRDs:

CRDDescription
DirectPVDriveRepresents a drive managed by DirectPV.
DirectPVVolumeRepresents a volume provisioned on a drive.
DirectPVNodeRepresents a node with discovered devices.
DirectPVInitRequestRepresents a drive initialization request.

All CRDs use:

  • API Group: directpv.min.io
  • API Version: v1beta1
  • Scope: Cluster

DirectPVDrive

Represents a drive that DirectPV manages for volume provisioning.

Spec fields

FieldTypeRequiredDescription
unschedulablebooleanNoWhen true, marks the drive as unavailable for volume scheduling.
relabelbooleanNoWhen true, indicates the drive filesystem should be relabeled.

Status fields

FieldTypeRequiredDescription
totalCapacityint64YesTotal storage capacity of the drive in bytes.
allocatedCapacityint64YesCapacity allocated to volumes in bytes.
freeCapacityint64YesFree capacity available in bytes. Deprecated: calculated as totalCapacity - allocatedCapacity.
fsuuidstringYesFilesystem UUID identifying the drive.
statusstringYesCurrent drive status. See Drive status values.
topologymap[string]stringYesTopology labels (node, zone, region, rack).
makestringNoDrive manufacturer information.
conditions[]ConditionNoArray of condition objects for error states. See Drive conditions.

Drive status values

StatusDescription
ReadyDrive is ready for volume scheduling.
LostAssociated data by FSUUID is lost.
ErrorDrive is in error state and volume scheduling is prevented.
RemovedDrive is removed.
MovingDrive is moving volumes.
RepairingDrive filesystem is being repaired.

Drive conditions

Condition typeDescription
MountErrorDrive has a mount error.
MultipleMatchesDrive has multiple matches.
IOErrorDrive has an I/O error.
RelabelErrorDrive has a relabel error.

Drive labels

DirectPV applies these labels to drive resources:

LabelDescription
directpv.min.io/nodeNode ID where the drive is located.
directpv.min.io/drive-nameDrive name (for example, sda, nvme0n1).
directpv.min.io/access-tierAccess tier (Default, Warm, Hot, Cold).
directpv.min.io/versionAPI version.
directpv.min.io/created-byComponent that created the resource.
directpv.min.io/migratedMigration flag for legacy DirectCSI drives.
directpv.min.io/suspendSuspension flag (true or false).

Example

apiVersion: directpv.min.io/v1beta1
kind: DirectPVDrive
metadata:
  name: 8a1b2c3d-4e5f-6789-abcd-ef0123456789
  labels:
    directpv.min.io/node: node1
    directpv.min.io/drive-name: nvme0n1
    directpv.min.io/access-tier: hot
spec:
  unschedulable: false
status:
  totalCapacity: 1000204886016
  allocatedCapacity: 536870912
  freeCapacity: 999668015104
  fsuuid: a1b2c3d4-e5f6-7890-abcd-ef0123456789
  status: Ready
  topology:
    directpv.min.io/node: node1
  make: Samsung

DirectPVVolume

Represents a volume provisioned on a DirectPV drive.

Spec fields

DirectPVVolume has no spec fields. All configuration is in the status section.

Status fields

FieldTypeRequiredDescription
dataPathstringYesPath where volume data is stored on the drive.
stagingTargetPathstringYesKubernetes CSI staging target path.
targetPathstringYesKubernetes CSI target path where volume is published.
fsuuidstringYesFilesystem UUID of the associated drive.
totalCapacityint64YesTotal capacity allocated to volume in bytes.
availableCapacityint64YesCurrently available capacity in bytes.
usedCapacityint64YesCurrently used capacity in bytes.
statusstringYesCurrent volume status. See Volume status values.
requestParametersmap[string]stringNoCSI request parameters for volume creation.
preferredAccessibleTopology[]map[string]stringNoPreferred topology for volume accessibility.
requisiteAccessibleTopology[]map[string]stringNoRequired topology for volume accessibility.
conditions[]ConditionNoArray of condition objects.

Volume status values

StatusDescription
PendingVolume creation in progress.
ReadyVolume is ready for use.

Volume conditions

Condition typeDescription
LostVolume is lost because the associated drive was removed.

Volume labels

DirectPV applies these labels to volume resources:

LabelDescription
directpv.min.io/nodeNode ID where the drive is located.
directpv.min.io/driveAssociated drive ID.
directpv.min.io/drive-nameAssociated drive name.
directpv.min.io/pod.nameAssociated pod name.
directpv.min.io/pod.namespaceAssociated pod namespace.
directpv.min.io/pod.statefulsetAssociated StatefulSet name.
directpv.min.io/versionAPI version.
directpv.min.io/created-byComponent that created the resource.
directpv.min.io/migratedMigration flag.
directpv.min.io/suspendSuspension flag.
directpv.min.io/tenantTenant name.

Example

apiVersion: directpv.min.io/v1beta1
kind: DirectPVVolume
metadata:
  name: pvc-12345678-90ab-cdef-1234-567890abcdef
  labels:
    directpv.min.io/node: node1
    directpv.min.io/drive: 8a1b2c3d-4e5f-6789-abcd-ef0123456789
    directpv.min.io/drive-name: nvme0n1
    directpv.min.io/pod.name: minio-0
    directpv.min.io/pod.namespace: default
status:
  dataPath: /var/lib/directpv/mnt/8a1b2c3d-4e5f-6789-abcd-ef0123456789/pvc-12345678-90ab-cdef-1234-567890abcdef
  stagingTargetPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv/pvc-12345678-90ab-cdef-1234-567890abcdef/globalmount
  targetPath: /var/lib/kubelet/pods/abcd1234-5678-90ab-cdef-1234567890ab/volumes/kubernetes.io~csi/pvc-12345678-90ab-cdef-1234-567890abcdef/mount
  fsuuid: a1b2c3d4-e5f6-7890-abcd-ef0123456789
  totalCapacity: 536870912
  availableCapacity: 268435456
  usedCapacity: 268435456
  status: Ready

DirectPVNode

Represents a node with devices that DirectPV has discovered.

Spec fields

FieldTypeRequiredDescription
refreshbooleanNoWhen true, signals the node to refresh device discovery.

Status fields

FieldTypeRequiredDescription
devices[]DeviceYesList of devices discovered on the node.
conditions[]ConditionNoArray of condition objects.

Device structure

FieldTypeRequiredDescription
namestringYesDevice name (for example, /dev/sda).
idstringYesUnique device ID (WWN or serial number).
majorMinorstringYesDevice major:minor number.
sizeint64YesDevice size in bytes.
makestringNoDevice manufacturer information.
fsTypestringNoFilesystem type if formatted.
fsuuidstringNoFilesystem UUID if formatted.
deniedReasonstringNoReason why device was denied for DirectPV use.

Node labels

LabelDescription
directpv.min.io/nodeNode ID.
directpv.min.io/versionAPI version.
directpv.min.io/created-byComponent that created the resource.

Example

apiVersion: directpv.min.io/v1beta1
kind: DirectPVNode
metadata:
  name: node1
  labels:
    directpv.min.io/node: node1
spec:
  refresh: false
status:
  devices:
    - name: /dev/nvme0n1
      id: nvme.samsung-MZQLB960HAJR-00007-S4YNNE0N123456
      majorMinor: "259:0"
      size: 960197124096
      make: Samsung
    - name: /dev/sda
      id: scsi-SATA_WDC_WD10EZEX-00B_WD-WMC3F0123456
      majorMinor: "8:0"
      size: 1000204886016
      make: WDC
      deniedReason: "in use by system"

DirectPVInitRequest

Represents a request to initialize drives for DirectPV management.

Spec fields

FieldTypeRequiredDescription
devices[]InitDeviceYesList of devices to initialize.

InitDevice structure

FieldTypeRequiredDescription
idstringYesDevice ID (unique identifier on node).
namestringYesDevice name (for example, /dev/sda).
forcebooleanYesForce initialization even if data exists.

Status fields

FieldTypeRequiredDescription
statusstringYesCurrent initialization request status. See Init status values.
results[]InitDeviceResultYesResults of initialization for each device.

Init status values

StatusDescription
PendingInitialization request is still pending.
ProcessedInitialization request has been processed.
ErrorInitialization request failed.

InitDeviceResult structure

FieldTypeRequiredDescription
namestringYesDevice name.
errorstringNoError message if initialization failed.

Init request labels

LabelDescription
directpv.min.io/nodeNode ID where initialization occurs.
directpv.min.io/versionAPI version.
directpv.min.io/created-byComponent that created the resource.
directpv.min.io/request-idRequest ID.

Example

apiVersion: directpv.min.io/v1beta1
kind: DirectPVInitRequest
metadata:
  name: c24e22f5-d582-49ba-a883-2ce56909904e
  labels:
    directpv.min.io/node: node1
    directpv.min.io/request-id: c24e22f5-d582-49ba-a883-2ce56909904e
spec:
  devices:
    - id: nvme.samsung-MZQLB960HAJR-00007-S4YNNE0N123456
      name: /dev/nvme0n1
      force: false
status:
  status: Processed
  results:
    - name: /dev/nvme0n1

Condition structure

All CRDs use standard Kubernetes conditions:

FieldTypeDescription
typestringCondition type (CamelCase, max 316 characters).
statusstringOne of: True, False, Unknown.
reasonstringReason for condition (CamelCase, max 1024 characters).
messagestringHuman-readable message (max 32768 characters).
lastTransitionTimetimeTimestamp of last status change.
observedGenerationint64Generation number when condition was set.

On this page