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
systemctl
service. - Removes the
/etc/pwx
and/opt/pwx
directories. - 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.
Uninstall Portworx
- Kubernetes
- OpenShift
-
Use the
kubectl get
command to display the name of your Portworx CSI storage cluster:kubectl get -n <px-namespace> storagecluster <storagecluster-name>
-
Enter the
kubectl edit
command to modify your storage cluster and specify your namespace:kubectl edit -n portworx storagecluster <storagecluster-name>
-
Modify your
StorageCluster
object, adding thedeleteStrategy
field with either theUninstall
orUninstallAndWipe
type:-
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:
cautionWipe operations remove all data from your disks permanently including the Portworx CSI metadata.
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 get
command to display the name of your Portworx CSI storage cluster and specify your namespace:oc get -n portworx storagecluster <storagecluster-name>
-
Enter the
oc edit
command to modify your storage cluster and specify your namespace:oc edit -n portworx storagecluster <storagecluster-name>
-
Modify your
StorageCluster
object, adding thedeleteStrategy
field with either theUninstall
orUninstallAndWipe
type:-
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:
cautionWipe operations remove all data from your disks permanently including the Portworx CSI metadata.
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 portworx
noteThis operation can take several minutes to complete.
-
Delete the operator:
oc delete deployment -n <px-namespace> portworx-operator