Uninstall Portworx CSI
You might need to uninstall Portworx CSI if it was installed in the wrong namespace or if you plan to decommission a cluster. You can uninstall Portworx CSI from your clusters using the Portworx Operator by updating the StorageCluster object. During the uninstallation process, you can choose to retain the Portworx metadata or wipe them completely.
-
Uninstall option:
- Removes the Kubernetes objects.
- Removes the Portworx
systemctlservice. - Removes the
/etc/pwxand/opt/pwxdirectories. - Removes all traces of Portworx CSI on the nodes.
noteThe drives are not formatted, and none of the Portworx CSI metadata in the KVDB is deleted.
-
Uninstall and wipe option:
- Removes all resources listed in the uninstall option.
- Permanently removes all the Portworx CSI metadata.
noteThe backend drives are not deleted; they will remain stale.
Uninstall Portworx
- Kubernetes
- OpenShift
-
Use the
kubectl getcommand to display the name of your Portworx CSI storage cluster:kubectl get -n <px-namespace> storagecluster <storagecluster-name> -
Enter the
kubectl editcommand to modify your storage cluster and specify your namespace:kubectl edit -n portworx storagecluster <storagecluster-name> -
Modify your
StorageClusterobject, adding thedeleteStrategyfield with either theUninstallorUninstallAndWipetype:-
Uninstall Portworx CSI only:
apiVersion: core.libopenstorage.org/v1
kind: StorageCluster
metadata:
name: portworx
namespace: portworx
spec:
deleteStrategy:
type: Uninstall -
Uninstall Portworx CSI and wipe all drives:
cautionThe wipe operation removes all Portworx CSI metadata. The backend drives are not deleted but will remain in a stale state.
apiVersion: core.libopenstorage.org/v1
kind: StorageCluster
metadata:
name: portworx
namespace: portworx
spec:
deleteStrategy:
type: UninstallAndWipe
-
-
Delete the StorageCluster by running the following command:
kubectl delete StorageCluster <storagecluster-name> -n <px-namespace>This operation can take several minutes to complete.
-
Delete the Portworx Operator deployment:
kubectl delete deployment -n <px-namespace> portworx-operator
-
Enter the
oc getcommand to display the name of your Portworx CSI storage cluster and specify your namespace:oc get -n portworx storagecluster <storagecluster-name> -
Enter the
oc editcommand to modify your storage cluster and specify your namespace:oc edit -n portworx storagecluster <storagecluster-name> -
Modify your
StorageClusterobject, adding thedeleteStrategyfield with either theUninstallorUninstallAndWipetype:-
Uninstall Portworx CSI only:
apiVersion: core.libopenstorage.org/v1
kind: StorageCluster
metadata:
name: portworx
namespace: portworx
spec:
deleteStrategy:
type: Uninstall -
Uninstall Portworx CSI and wipe all drives:
cautionThe wipe operation removes all Portworx CSI metadata. The backend drives are not deleted but will remain in a stale state.
apiVersion: core.libopenstorage.org/v1
kind: StorageCluster
metadata:
name: portworx
namespace: portworx
spec:
deleteStrategy:
type: UninstallAndWipe
-
-
Delete the StorageCluster by running the following command:
oc delete StorageCluster <your-storagecluster-name> -n portworxnoteThis operation can take several minutes to complete.