|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * rosa_hcp/rosa-hcp-deleting-cluster.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="rosa-hcp-deleting-cluster_{context}"] |
| 7 | += Deleting a {hcp-title} cluster and the cluster-specific IAM resources |
| 8 | + |
| 9 | +You can delete a {hcp-title} cluster by using the ROSA command line interface (CLI) (`rosa`) or {cluster-manager-first}. |
| 10 | + |
| 11 | +After deleting the cluster, you can clean up the cluster-specific Identity and Access Management (IAM) resources in your AWS account by using the ROSA CLI. The cluster-specific resources include the Operator roles and the OpenID Connect (OIDC) provider. |
| 12 | + |
| 13 | +[NOTE] |
| 14 | +==== |
| 15 | +The cluster deletion must complete before you remove the IAM resources, because the resources are used in the cluster deletion and clean up processes. |
| 16 | +==== |
| 17 | + |
| 18 | +If add-ons are installed, the cluster deletion takes longer because add-ons are uninstalled before the cluster is deleted. The amount of time depends on the number and size of the add-ons. |
| 19 | + |
| 20 | +.Prerequisites |
| 21 | + |
| 22 | +* You have installed a {hcp-title} cluster. |
| 23 | +* You have installed and configured the latest ROSA CLI (`rosa`) on your installation host. |
| 24 | +
|
| 25 | +.Procedure |
| 26 | + |
| 27 | +. Get the cluster ID, the Amazon Resource Names (ARNs) for the cluster-specific Operator roles, and the endpoint URL for the OIDC provider by running the following command: |
| 28 | ++ |
| 29 | +[source,terminal] |
| 30 | +---- |
| 31 | +$ rosa describe cluster --cluster=<cluster_name> |
| 32 | +---- |
| 33 | ++ |
| 34 | +.Example output |
| 35 | +[source,terminal] |
| 36 | +---- |
| 37 | +Name: test_cluster |
| 38 | +Domain Prefix: test_cluster |
| 39 | +Display Name: test_cluster |
| 40 | +ID: <cluster_id> <1> |
| 41 | +External ID: <external_id> |
| 42 | +Control Plane: ROSA Service Hosted |
| 43 | +OpenShift Version: 4.15.0 |
| 44 | +Channel Group: stable |
| 45 | +DNS: test_cluster.l3cn.p3.openshiftapps.com |
| 46 | +AWS Account: <AWS_id> |
| 47 | +AWS Billing Account: <AWS_id> |
| 48 | +API URL: https://api.test_cluster.l3cn.p3.openshiftapps.com:443 |
| 49 | +Console URL: |
| 50 | +Region: us-east-1 |
| 51 | +Availability: |
| 52 | + - Control Plane: MultiAZ |
| 53 | + - Data Plane: SingleAZ |
| 54 | +
|
| 55 | +Nodes: |
| 56 | + - Compute (desired): 2 |
| 57 | + - Compute (current): 0 |
| 58 | +Network: |
| 59 | + - Type: OVNKubernetes |
| 60 | + - Service CIDR: 172.30.0.0/16 |
| 61 | + - Machine CIDR: 10.0.0.0/16 |
| 62 | + - Pod CIDR: 10.128.0.0/14 |
| 63 | + - Host Prefix: /23 |
| 64 | + - Subnets: <subnet_ids> |
| 65 | +EC2 Metadata Http Tokens: optional |
| 66 | +Role (STS) ARN: arn:aws:iam::<AWS_id>:role/test_cluster-HCP-ROSA-Installer-Role |
| 67 | +Support Role ARN: arn:aws:iam::<AWS_id>:role/test_cluster-HCP-ROSA-Support-Role |
| 68 | +Instance IAM Roles: |
| 69 | + - Worker: arn:aws:iam::<AWS_id>:role/test_cluster-HCP-ROSA-Worker-Role |
| 70 | +Operator IAM Roles: <2> |
| 71 | + - arn:aws:iam::<AWS_id>:role/test_cluster-openshift-cloud-network-config-controller-cloud-crede |
| 72 | + - arn:aws:iam::<AWS_id>:role/test_cluster-openshift-image-registry-installer-cloud-credentials |
| 73 | + - arn:aws:iam::<AWS_id>:role/test_cluster-openshift-ingress-operator-cloud-credentials |
| 74 | + - arn:aws:iam::<AWS_id>:role/test_cluster-kube-system-kube-controller-manager |
| 75 | + - arn:aws:iam::<AWS_id>:role/test_cluster-kube-system-capa-controller-manager |
| 76 | + - arn:aws:iam::<AWS_id>:role/test_cluster-kube-system-control-plane-operator |
| 77 | + - arn:aws:iam::<AWS_id>:role/hcpcluster-kube-system-kms-provider |
| 78 | + - arn:aws:iam::<AWS_id>:role/test_cluster-openshift-cluster-csi-drivers-ebs-cloud-credentials |
| 79 | +Managed Policies: Yes |
| 80 | +State: ready |
| 81 | +Private: No |
| 82 | +Created: Apr 16 2024 20:32:06 UTC |
| 83 | +User Workload Monitoring: Enabled |
| 84 | +Details Page: https://console.redhat.com/openshift/details/s/<cluster_id> |
| 85 | +OIDC Endpoint URL: https://oidc.op1.openshiftapps.com/<cluster_id> (Managed) <3> |
| 86 | +Audit Log Forwarding: Disabled |
| 87 | +External Authentication: Disabled |
| 88 | +---- |
| 89 | +<1> Lists the cluster ID. |
| 90 | +<2> Specifies the ARNs for the cluster-specific Operator roles. For example, in the sample output the ARN for the role required by the Machine Config Operator is `arn:aws:iam::<aws_account_id>:role/mycluster-x4q9-openshift-machine-api-aws-cloud-credentials`. |
| 91 | +<3> Displays the endpoint URL for the cluster-specific OIDC provider. |
| 92 | ++ |
| 93 | +[IMPORTANT] |
| 94 | +==== |
| 95 | +After the cluster is deleted, you need the cluster ID to delete the cluster-specific STS resources using the ROSA CLI. |
| 96 | +==== |
| 97 | + |
| 98 | +. Delete the cluster by using either the {cluster-manager} or the ROSA CLI (`rosa`): |
| 99 | +** To delete the cluster by using the {cluster-manager}: |
| 100 | +.. Navigate to the {cluster-manager-url}. |
| 101 | +.. Click the Options menu {kebab} next to your cluster and select *Delete cluster*. |
| 102 | +.. Type the name of your cluster into the prompt and click *Delete*. |
| 103 | +** To delete the cluster using the ROSA CLI: |
| 104 | +.. Run the following command, replacing `<cluster_name>` with the name or ID of your cluster: |
| 105 | ++ |
| 106 | +[source,terminal] |
| 107 | +---- |
| 108 | +$ rosa delete cluster --cluster=<cluster_name> --watch |
| 109 | +---- |
| 110 | ++ |
| 111 | +[IMPORTANT] |
| 112 | +==== |
| 113 | +You must wait for cluster deletion to complete before you remove the Operator roles and the OIDC provider. |
| 114 | +==== |
| 115 | + |
| 116 | +. Delete the cluster-specific Operator IAM roles by running the following command: |
| 117 | ++ |
| 118 | +[source,terminal] |
| 119 | +---- |
| 120 | +$ rosa delete operator-roles --prefix <operator_role_prefix> |
| 121 | +---- |
| 122 | + |
| 123 | +. Delete the OIDC provider by running the following command: |
| 124 | ++ |
| 125 | +[source,terminal] |
| 126 | +---- |
| 127 | +$ rosa delete oidc-provider --oidc-config-id <oidc_config_id> |
| 128 | +---- |
| 129 | + |
| 130 | +//If reusing, porting, or separating this content, make sure to grab the "Troubleshooting" section from the assembly. It could not be included in the module because of xrefs. |
0 commit comments