이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 16. Destroying a hosted cluster


16.1. Destroying a hosted cluster on AWS

You can destroy a hosted cluster and its managed cluster resource on Amazon Web Services (AWS) by using the command-line interface (CLI).

16.1.1. Destroying a hosted cluster on AWS by using the CLI

You can use the command-line interface (CLI) to destroy a hosted cluster on Amazon Web Services (AWS).

Procedure

  1. Delete the managed cluster resource on multicluster engine Operator by running the following command:

    $ oc delete managedcluster <hosted_cluster_name> 
    1
    Copy to Clipboard Toggle word wrap
    1
    Replace <hosted_cluster_name> with the name of your cluster.
  2. Delete the hosted cluster and its backend resources by running the following command:

    $ hcp destroy cluster aws  \
      --name <hosted_cluster_name> \
    1
    
      --infra-id <infra_id> \
    2
    
      --role-arn <arn_role> \
    3
    
      --sts-creds <path_to_sts_credential_file> \
    4
    
      --base-domain <basedomain> 
    5
    Copy to Clipboard Toggle word wrap
    1
    Specify the name of your hosted cluster, for instance, example.
    2
    Specify the infrastructure name for your hosted cluster.
    3
    Specify the Amazon Resource Name (ARN), for example, arn:aws:iam::820196288204:role/myrole.
    4
    Specify the path to your AWS Security Token Service (STS) credentials file, for example, /home/user/sts-creds/sts-creds.json.
    5
    Specify your base domain, for example, example.com.
    Important

    If your session token for AWS Security Token Service (STS) is expired, retrieve the STS credentials in a JSON file named sts-creds.json by running the following command:

    $ aws sts get-session-token --output json > sts-creds.json
    Copy to Clipboard Toggle word wrap

16.2. Destroying a hosted cluster on bare metal

You can destroy hosted clusters on bare metal by using the command-line interface (CLI) or the multicluster engine Operator web console.

16.2.1. Destroying a hosted cluster on bare metal by using the CLI

If you created a hosted cluster by using the command-line interface (CLI), you can destroy that hosted cluster and its back-end resources by running a command.

Procedure

  • Delete the hosted cluster and its back-end resources by running the following command:

    $ oc delete -f <hosted_cluster_config>.yaml 
    1
    Copy to Clipboard Toggle word wrap
    1
    Specify the name of the configuration YAML file that was rendered when you created the hosted cluster.
    Note

    If you created the hosted cluster without specifying the --render and --render-sensitive flags in its configuration file, you must remove its back-end resources manually.

16.2.2. Destroying a hosted cluster on bare metal by using the web console

You can use the multicluster engine Operator web console to destroy a hosted cluster on bare metal.

Procedure

  1. In the console, click Infrastructure Clusters.
  2. On the Clusters page, select the cluster that you want to destroy.
  3. In the Actions menu, select Destroy clusters to remove the cluster.

16.3. Destroying a hosted cluster on OpenShift Virtualization

You can destroy a hosted cluster and its managed cluster resource on OpenShift Virtualization by using the command-line interface (CLI).

16.3.1. Destroying a hosted cluster on OpenShift Virtualization by using the CLI

You can use the command-line interface (CLI) to destroy a hosted cluster and its managed cluster resource on OpenShift Virtualization.

Procedure

  1. Delete the managed cluster resource on multicluster engine Operator by running the following command:

    $ oc delete managedcluster <hosted_cluster_name>
    Copy to Clipboard Toggle word wrap
  2. Delete the hosted cluster and its backend resources by running the following command:

    $ hcp destroy cluster kubevirt --name <hosted_cluster_name>
    Copy to Clipboard Toggle word wrap

16.4. Destroying a hosted cluster on IBM Z

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

16.4.1. 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
    Copy to Clipboard Toggle word wrap

    After the NodePool object is scaled to 0, the compute nodes are detached from the hosted cluster. In OpenShift Container Platform version 4.17, this function is applicable only for IBM Z with KVM. For z/VM and LPAR, you must delete the compute nodes manually.

    If you want to re-attach compute nodes to the cluster, you can scale up the NodePool object with the number of compute nodes that you want. For z/VM and LPAR to reuse the agents, you must re-create them by using the Discovery image.

    Important

    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>
    Copy to Clipboard Toggle word wrap

    If you are using an OSA network device in Processor Resource/Systems Manager (PR/SM) mode, auto scaling is not supported. You must delete the old agent manually and scale up the node pool because the new agent joins during the scale down process.

  2. Verify the status of the compute nodes by entering the following command:

    $ oc --kubeconfig <hosted_cluster_name>.kubeconfig get nodes
    Copy to Clipboard Toggle word wrap

    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>
    Copy to Clipboard Toggle word wrap
    Note

    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>
    Copy to Clipboard Toggle word wrap

16.5. Destroying a hosted cluster on IBM Power

You can destroy a hosted cluster on IBM Power by using the command-line interface (CLI).

16.5.1. Destroying a hosted cluster on IBM Power by using the CLI

To destroy a hosted cluster on IBM Power, you can use the hcp command-line interface (CLI).

Procedure

  • Delete the hosted cluster by running the following command:

    $ hcp destroy cluster agent
     --name=<hosted_cluster_name> \
    1
    
     --namespace=<hosted_cluster_namespace> \
    2
    
     --cluster-grace-period <duration> 
    3
    Copy to Clipboard Toggle word wrap
    1
    Replace <hosted_cluster_name> with the name of your hosted cluster.
    2
    Replace <hosted_cluster_namespace> with the name of your hosted cluster namespace.
    3
    Specifies the duration to destroy the hosted cluster completely, for example, 20m0s.

16.6. Destroying a hosted cluster on non-bare-metal agent machines

You can destroy hosted clusters on non-bare-metal agent machines by using the command-line interface (CLI) or the multicluster engine Operator web console.

16.6.1. Destroying a hosted cluster on non-bare-metal agent machines

You can use the hcp command-line interface (CLI) to destroy a hosted cluster on non-bare-metal agent machines.

Procedure

  • Delete the hosted cluster and its backend resources by running the following command:

    $ hcp destroy cluster agent --name <hosted_cluster_name> 
    1
    Copy to Clipboard Toggle word wrap
    1
    Replace <hosted_cluster_name> with the name of your hosted cluster.

You can use the multicluster engine Operator web console to destroy a hosted cluster on non-bare-metal agent machines.

Procedure

  1. In the console, click Infrastructure Clusters.
  2. On the Clusters page, select the cluster that you want to destroy.
  3. In the Actions menu, select Destroy clusters to remove the cluster.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat