Skip to main content
Version: 2.8

Delete clusters

A Kubernetes cluster added to Portworx Backup can be of the following states:

  • Active: when a Kubernetes cluster is in an active state, it generally means that the cluster is fully operational and all of its components are running as expected. The cluster's control plane, which includes the API server, etcd (the key-value store), controller manager, and scheduler, is working properly. Additionally, the nodes (worker machines) are healthy, responsive, and ready to run workloads (pods). This means, Portworx Backup can communicate with the cluster and perform all backups and restore operatios seamlessly.

  • Disconnected: when a Kubernetes cluster is in a disconnected state, it means that the cluster is not communicating properly with the external control system or management interface (such as a cloud provider's Kubernetes dashboard, management service, or third-party tool). This can prevent you from managing or monitoring the cluster effectively. The disconnected state does not necessarily mean that the cluster itself is down, but rather that the link between the control plane and the cluster is interrupted. In this state, Portworx backup user will not be able to back up any namespaces or VMs.

  • Unknown: cluster is deleted from the backend.

When you delete a cluster that is in active state, Portworx Backup deletes both, the cluster and the corresponding schedule CRs from the backend.

Starting from Portworx Backup 2.8.0, Portworx Backup allows you to delete a cluster even if it is in a disconnected state. When you delete a such a cluster, cluster gets deleted but the schedule Custom Resource (CRs) associated with the cluster will not be deleted due to communication failure between Portworx Backup and the cluster. These CRs occupy lot of space if they are in larger number. Hence, you should manually delete those CRs to free up space.

To delete the schedule CRs manually, perform the following steps:

  1. Find the UID of the cluster that you want to delete:

    a. From the home page, in the left navigation pane, click Clusters.

    b. In the Clusters page, select the cluster you want to delete.

    c. At the end of the cluster row, click on the Vertical ellipsis and choose View Json.

    d. Copy the cluster uid in metadata section.

  2. To find the schedule CRs you want to delete, run the following command from the application cluster. Ensure that you replace <cluster-uid> with the value you obtained in step 1d.

    kubectl get applicationbackupschedules -A -o json | jq '.items[] | select(.metadata.annotations["portworx.io/cluster-uid"] == "<cluster-uid>") | .metadata.name'

    This step lists all the schedules Portworx Backup has created in the application cluster.

  3. Now, delete all the schedules obtained from step 2 by running the following command:

    • To delete one schedule at a time, run the following command:

      kubectl delete applicationbackupschedules <schedule-name>
    • To delete multiple schedules at a time, run the following command:

      kubectl delete applicationbackupschedules <schedule-name1>, <schedule-name2>, ........<schedule-namex>