Uninstall Portworx from a Kubernetes cluster using the Operator
Using the Portworx Operator, you can efficiently uninstall Portworx from your clusters. This can be achieved by updating the StorageCluster object, and you have the option to either keep the data on your drives or wipe them completely.
- Uninstall: Removes the Kubernetes objects, Portworx systemctlservice,/etc/pwxand/opt/pwxdirectories, and all traces of Portworx on the nodes. The drives will not be formatted and Portworx Metadata in the KVDB will not be deleted. You may need to uninstall Portworx if you installed it in the wrong namespace.
- Uninstall and wipe: Removes all of the resources listed in the "Uninstall" procedure, and also removes (formats) all data from your disks permanently, including the Portworx metadata. You may want to perform an uninstall and wipe when you decommission a cluster.
Prerequisites
- A successfully deployed Portworx Operator on your cluster.
Uninstall Portworx
- Kubernetes
- Openshift
- 
Display the Portworx StorageCluster: Use the kubectl getcommand to display the name of your Portworx storage cluster:kubectl get -n <px-namespace> storagecluster <storagecluster-name>
- 
Edit the StorageCluster: Modify your storage cluster to initiate the uninstall process: kubectl edit -n <px-namespace> storagecluster <storagecluster-name>Update the deleteStrategyfield in theStorageClusterobject:- 
For Uninstall Only: apiVersion: core.libopenstorage.org/v1
 kind: StorageCluster
 metadata:
 name: portworx
 namespace: <px-namespace>
 spec:
 deleteStrategy:
 type: Uninstall
- 
For Uninstall and Wipe: apiVersion: core.libopenstorage.org/v1
 kind: StorageCluster
 metadata:
 name: portworx
 namespace: <px-namespace>
 spec:
 deleteStrategy:
 type: UninstallAndWipenoteWiping operations will permanently remove all data, including Portworx metadata, from your disks. 
 
- 
- 
Delete the StorageCluster: Execute the following command, specifying your StorageClusterobject:kubectl delete StorageCluster <storagecluster-name> -n <px-namespace>This operation can take several minutes to complete. 
- 
Remove the Portworx Operator: Finally, delete the Portworx Operator deployment: kubectl delete deployment -n <px-namespace> portworx-operator
- 
Display the Portworx StorageCluster: Enter the oc getcommand to display the name of your Portworx storage cluster and specify your namespace:oc get -n portworx storagecluster <storagecluster-name>
- 
Edit the StorageCluster: 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 only: apiVersion: core.libopenstorage.org/v1
 kind: StorageCluster
 metadata:
 name: portworx
 namespace: portworx
 spec:
 deleteStrategy:
 type: Uninstall
- 
Uninstall Portworx and wipe all drives: noteWipe operations remove all data from your disks permanently including the Portworx metadata, use caution when applying the DeleteStrategy spec. apiVersion: core.libopenstorage.org/v1
 kind: StorageCluster
 metadata:
 name: portworx
 namespace: portworx
 spec:
 deleteStrategy:
 type: UninstallAndWipe
 
- 
- 
Delete the StorageCluster: Enter the oc deletecommand, specifying the name of yourStorageClusterobject and specify your namespace:oc delete StorageCluster <your-storagecluster-name> -n portworxnoteThis operation can take several minutes to complete. 
- 
Remove the Portworx Operator: Finally, delete the Portworx Operator deployment: oc delete deployment -n <px-namespace> portworx-operator