Delete a cluster in ROSA
To delete a Red Hat® OpenShift® Service on AWS (ROSA) cluster, follow the steps below.
What will you learn?
- How to delete a cluster
Delete a cluster
- If you need to list your clusters in order to make sure you are deleting the correct one run:
rosa list clusters
- Once you know which one to delete run:
rosa delete cluster --cluster <cluster-name>
- You will be prompted to confirm that you want to delete the named cluster. Press “y”, then enter. The cluster will be deleted and all its associated infrastructure. THIS IS NON-RECOVERABLE.
NOTE: All AWS STS/IAM roles and policies will remain and must be deleted manually once the cluster deletion is complete by following the steps below.
The command will output the next two commands to delete the other resources that were created. You must wait until the cluster has finished deleting (from the previous command). You can use rosa list clusters to do a quick status check.
- Once complete, delete the:
OpenID Connect (OIDC) provider that you created for Operator authentication. Run:
rosa delete oidc-provider -c <clusterID> --mode auto --yes
Cluster-specific Operator IAM roles. Run:
rosa delete operator-roles -c <clusterID> --mode auto --yes
NOTE: The above steps require you to use the cluster id and not the cluster name.
- The remaining roles would be account-scoped and should only be removed if they are no longer needed by other clusters in the same account. (In other words, if you would still like to create other ROSA clusters in this account, do not perform this step.)
To delete these, you need to know the prefix used when creating them. The default is "ManagedOpenShift" unless you specified otherwise.
rosa delete account-roles --prefix <prefix> --mode auto --yes
You have now completed all the required steps for deploying and managing your first cluster. In the next resource, we’ll discuss ways you can get support.
This learning path is for operations teams or system administrators
Developers may want to check out developers.redhat.com.