Skip to main content
Version: 3.6

Uninstall Portworx from a Kubernetes cluster using the Operator

Using the Portworx Operator, you can efficiently uninstall Portworx from your clusters by updating the StorageCluster object. You have the option to either keep the data on your drives or wipe it completely.

  • Uninstall: Removes the Kubernetes objects, Portworx systemctl service, /etc/pwx and /opt/pwx directories, and all traces of Portworx on the nodes. The drives are not formatted and Portworx Metadata in the KVDB is not 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.
  • Uninstall and delete: Delete operations permanently remove all data from your disks, including Portworx metadata, and delete the cloud drive.
    • Supported on vSphere, AWS, GKE, and Azure with Operator version 25.5.0 or later and Portworx Enterprise version 3.5.0 or later.
    • Supported on Oracle Cloud Infrastructure, IBM Cloud, and FlashArray cloud drives with Operator version 26.3.0 or later and Portworx Enterprise version 3.6.2 or later.

Prerequisites

  • A successfully deployed Portworx Operator on your cluster.

Uninstall Portworx

  1. Display the Portworx StorageCluster:

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

    kubectl get -n <px-namespace> storagecluster <storagecluster-name>
  2. Edit the StorageCluster:

    Modify your storage cluster to initiate the uninstall process:

    kubectl edit -n <px-namespace> storagecluster <storagecluster-name>

    Update the deleteStrategy field in the StorageCluster object:

    note

    If PersistentVolumeClaims (PVCs) referencing a Portworx storage class are present on your cluster, the uninstall is blocked until all Portworx volumes are removed. To allow the uninstall to proceed, set spec.deleteStrategy.ignoreVolumes to true when using the UninstallAndWipe or UninstallAndDelete strategy.

    • For uninstall only:

      apiVersion: core.libopenstorage.org/v1
      kind: StorageCluster
      metadata:
      name: portworx
      namespace: <px-namespace>
      spec:
      deleteStrategy:
      type: Uninstall
    • For uninstall and wipe:
      Wipe 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: <px-namespace>
      spec:
      deleteStrategy:
      type: UninstallAndWipe
    • Uninstall and delete:
      Delete operations permanently remove all data from your disks, including Portworx metadata, and delete the cloud drive. Use caution when applying the deleteStrategy spec.

      apiVersion: core.libopenstorage.org/v1
      kind: StorageCluster
      metadata:
      name: portworx
      namespace: <px-namespace>
      spec:
      deleteStrategy:
      type: UninstallAndDelete
  3. Delete the StorageCluster:

    Execute the following command, specifying your StorageCluster object:

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

    This operation can take several minutes to complete.

  4. Remove the Portworx Operator:

    Finally, delete the Portworx Operator deployment:

    kubectl delete deployment -n <px-namespace> portworx-operator
In this topic: