Skip to main content

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.
    note

    The 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

  1. Use the kubectl get command to display the name of your Portworx CSI storage cluster:

    kubectl get -n <px-namespace> storagecluster <storagecluster-name>
  2. Enter the kubectl edit command to modify your storage cluster and specify your namespace:

    kubectl edit -n portworx storagecluster <storagecluster-name>
  3. Modify your StorageCluster object, adding the deleteStrategy field with either the Uninstall or UninstallAndWipe 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:

      caution

      Wipe 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
  4. Delete the StorageCluster by running the following command:

    kubectl delete StorageCluster <storagecluster-name> -n <px-namespace>

    This operation can take several minutes to complete.

  5. Delete the Portworx Operator deployment:

    kubectl delete deployment -n <px-namespace> portworx-operator