This is a cache of https://docs.okd.io/latest/hosted_control_planes/hcp-destroy/hcp-destroy-ibmz.html. It is a snapshot of the page at 2024-09-28T18:45:23.761+0000.
Destroying a hosted <strong>cluster</strong> on IBM Z - Destroying a hosted <strong>cluster</strong> | Hosted control planes | OKD 4
×

You can destroy a hosted cluster on x86 bare metal with IBM Z compute nodes and its managed cluster resource by using the command-line interface (CLI).

Destroying a hosted cluster on x86 bare metal with IBM Z compute nodes

To destroy a hosted cluster and its managed cluster on x86 bare metal with IBM Z compute nodes, you can use the command-line interface (CLI).

Procedure
  1. Scale the NodePool object to 0 nodes by running the following command:

    $ oc -n <hosted_cluster_namespace> scale nodepool <nodepool_name> --replicas 0

    If the compute nodes are not detached from the hosted cluster or are stuck in the Notready state, delete the compute nodes manually by running the following command:

    $ oc --kubeconfig <hosted_cluster_name>.kubeconfig delete node <compute_node_name>
  2. Verify the status of the compute nodes by entering the following command:

    $ oc --kubeconfig <hosted_cluster_name>.kubeconfig get nodes

    After the compute nodes are detached from the hosted cluster, the status of the agents is changed to auto-assign.

  3. Delete the agents from the cluster by running the following command:

    $ oc -n <hosted_control_plane_namespace> delete agent <agent_name>

    You can delete the virtual machines that you created as agents after you delete the agents from the cluster.

  4. Destroy the hosted cluster by running the following command:

    $ hcp destroy cluster agent --name <hosted_cluster_name> --namespace <hosted_cluster_namespace>