kubectl directpv uninstall
The kubectl directpv uninstall command removes DirectPV components from your Kubernetes cluster.
Data considerations
Uninstalling DirectPV removes the CSI driver and management components.
Existing data on initialized drives remains intact but becomes inaccessible to Kubernetes workloads.
Syntax
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 output messages. |
Examples
Uninstall DirectPV
Remove DirectPV from the cluster:
kubectl directpv uninstall
Silent uninstall
Uninstall without output (useful in scripts):
kubectl directpv uninstall --quiet
Behavior
Components removed
The uninstall command removes the following Kubernetes resources:
| Resource | Name | Description |
|---|---|---|
| Namespace | directpv |
Contains all DirectPV components. |
| DaemonSet | node-server |
Node-level drive management. |
| Deployment | controller |
Central controller for volume provisioning. |
| CSIDriver | directpv-min-io |
CSI driver registration. |
| StorageClass | directpv-min-io |
Default StorageClass for DirectPV volumes. |
| ServiceAccount, Roles, Bindings | directpv-min-io |
RBAC configuration. |
What happens to data
When you uninstall DirectPV:
- Drive data is preserved: Data on initialized drives remains on the physical disks.
- Volumes become inaccessible: Kubernetes workloads can no longer access DirectPV volumes.
- CRDs may be retained: Custom Resource Definitions (drives, volumes) may remain in the cluster.
Before uninstalling
Before uninstalling DirectPV, consider:
- Stop workloads: Terminate pods using DirectPV volumes to avoid disruption.
- Backup data: Copy important data from DirectPV volumes if needed.
- Remove volumes: Delete PersistentVolumeClaims using the
directpv-min-ioStorageClass.
Reinstalling DirectPV
To reinstall DirectPV after uninstalling:
- Run
kubectl directpv install. - Run
kubectl directpv discoverto detect drives. - Review the generated
drives.yamlfile. - Run
kubectl directpv initto reinitialize drives.
Previously initialized drives
Drives that were previously initialized by DirectPV may show existing filesystems during discovery.
Use
--all with the discover command to see these drives.