Delete a managed cluster

Deleting a managed cluster does not require a preliminary deletion of VMs that run on this cluster.

Warning

We recommend deleting cluster machines using the Container Cloud web UI or API instead of using the cloud provider tools directly. Otherwise, the cluster deletion or detachment may hang and additional manual steps will be required to clean up machine resources.

To delete an OpenStack-based managed cluster:

  1. Optional. Applies to clusters with volumes created using Persistent Volume Claims (PVCs). Select from the following options:

    • Since Container Cloud 2.24.0, skip this step as the system performs it automatically if you select the Delete all volumes in the cluster check box in the web UI as described below.

    • Since Container Cloud 2.23.0, schedule the volumes created using PVCs to be deleted during cluster deletion using the API:

      Caution

      The feature applies only to volumes created on clusters that are based on or updated to the Cluster release 11.7.0 or later.

      If you added volumes to an existing cluster before it was updated to the Cluster release 11.7.0, delete such volumes manually after the cluster deletion.

      1. Log in to the host where your management cluster kubeconfig is located and where kubectl is installed.

      2. In the value section of providerSpec of the Cluster object, set volumesCleanupEnabled to true:

        kubectl patch clusters.cluster.k8s.io -n <managedClusterProjectName> <managedclusterName> --type=merge -p   '{"spec":{"providerSpec":{"value":{"volumesCleanupEnabled":true}}}}'
        

        Replace the parameters enclosed in angle brackets with the corresponding values.

      Caution

      This feature is available as Technology Preview. Use such configuration for testing and evaluation purposes only. For the Technology Preview feature definition, refer to Technology Preview features.

  2. Log in to the Container Cloud web UI with the m:kaas:namespace@operator or m:kaas:namespace@writer permissions.

  3. Switch to the required project using the Switch Project action icon located on top of the main left-side navigation panel.

  4. In the Clusters tab, click the More action icon in the last column of the required cluster and select Delete.

  5. Verify and confirm the list of machines to be removed.

    Since the Container Cloud 2.24.0, if you do not plan to reuse volumes created using PVCs, select the Delete all volumes in the cluster .

    Caution

    The feature applies only to volumes created on clusters that are based on or updated to the Cluster release 11.7.0 or later.

    If you added volumes to an existing cluster before it was updated to the Cluster release 11.7.0, delete such volumes manually after the cluster deletion.

    Deleting a cluster automatically frees up the resources allocated for this cluster, for example, instances, load balancers, networks, floating IPs.

  6. If the cluster deletion hangs and the Deleting status message does not disappear after a while, refer to Cluster deletion or detachment freezes to fix the issue.

  7. If you do not plan to reuse the credentials of the deleted cluster, delete them:

    1. In the Credentials tab, verify that the required credentials are not in the In Use status.

    2. Click the Delete credential action icon next to the name of the credentials to be deleted.

    3. Confirm the deletion.

    Warning

    You can delete credentials only after deleting the managed cluster they relate to.