kubectl directpv uncordon

The kubectl directpv uncordon command allows DirectPV to schedule new volumes on previously cordoned drives. Use this command after maintenance is complete to restore drives to normal operation.

To prevent new volumes on drives, use kubectl directpv cordon.

Syntax

Parameters

DRIVE_ID

Optional

The unique identifier of one or more drives to uncordon. Specify multiple drive IDs separated by spaces. Use kubectl directpv list drives to find drive IDs.

--all

Optional

Uncordon all drives across all nodes. When specified, DirectPV ignores other selection flags.

--nodes

Optional

Uncordon drives on specific nodes. Specify multiple nodes as a comma-separated list or by repeating the flag. Supports ellipsis expansion notation.

Short form: -n

--drives

Optional

Uncordon drives by name. Specify multiple drives as a comma-separated list or by repeating the flag. Supports ellipsis expansion notation.

Short form: -d

--status

Optional

Uncordon drives with a specific status. Specify multiple statuses as a comma-separated list or by repeating the flag. Valid values: error, lost, moving, ready, removed.

--dry-run

Optional

Display the drives to uncordon, without making changes.

Global flags

This command supports the following global flags:

Flag Description
--kubeconfig Path to the kubeconfig file to use for CLI requests.
--quiet Suppress printing error messages.

Examples

Uncordon all drives in the cluster

Restore volume scheduling on all cordoned drives:

kubectl directpv uncordon --all

Uncordon a specific drive type across all nodes

Uncordon all nvme1n1 drives:

kubectl directpv uncordon --drives=nvme1n1

Uncordon drives on multiple nodes

Use ellipsis expansion to uncordon drives across a range of nodes:

kubectl directpv uncordon --nodes=node{1...4} --drives=sd{a...f}

Uncordon drives with error status

Restore drives that were cordoned due to errors:

kubectl directpv uncordon --status=error

Preview uncordon operation

Check which drives to uncordon, without making changes:

kubectl directpv uncordon --nodes=node1 --dry-run

Behavior

How uncordoning works

Uncordoning removes the cordon state from drives, allowing DirectPV to schedule new volumes on them. When you uncordon a drive:

  1. DirectPV removes the cordoned state from the drive.
  2. The drive becomes eligible for new volume scheduling requests.
  3. Existing volumes on the drive remain unaffected.
  4. The drive status no longer shows Cordoned when listed.

Selection requirements

This command requires at least one selection method. The command returns an error if no drives are selected.

Verify drive status

After uncordoning, verify the drive status:

kubectl directpv list drives

Uncordoned drives show Ready in the status column (assuming no other conditions).