Volume Commands

Use volume commands to view and manage the lifecycle of DirectPV-managed volumes on Kubernetes.

For step-by-step procedures on common volume operations, see Managing Volumes.

Commands

CommandDescription
list volumesDisplay volume status, capacity, and pod assignments
label volumesAdd, update, or remove labels on volumes
suspend volumesSuspend volumes for maintenance (mounts an empty read-only directory in place of the volume data)
resume volumesResume suspended volumes to restore normal operation

Common workflows

View volumes by status

List all volumes or filter by status:

kubectl directpv list volumes --all
kubectl directpv list volumes --status=pending

Find volumes for a specific pod

Filter volumes by pod name or namespace:

kubectl directpv list volumes --pod-names=minio-{0...3}
kubectl directpv list volumes --pod-namespaces=production

Label volumes for identification

Add custom labels to volumes for organizational purposes:

kubectl directpv label volumes tier=hot --nodes=node1

For information on labeling, see label volumes.

Suspend and resume volumes

Suspend volumes to allow StatefulSet pods to start while addressing issues. A suspended volume does not give pods its data: DirectPV mounts an empty, read-only directory in its place. See the warning in suspend volumes before you start.

  1. Suspend the volume using suspend volumes.
  2. Address the underlying issue.
  3. Resume the volume using resume volumes.

For details on volume scheduling, see Scheduling.

On this page