OpenShift Cookbook
上QQ阅读APP看书,第一时间看更新

Deleting a domain using rhc

You created a domain for testing and now you no longer require it. Naturally, you would like to delete the domain.

Getting ready

To complete the steps in this recipe, you will need rhc to be installed on your machine.

How to do it…

You should run the following command to delete a domain:

$ rhc delete-domain --namespace testosbook

Note

Once the domain is deleted, there is no way to undo it. So, please use this command with precaution.

How it works…

The rhc delete-domain command will delete the domain by making a REST delete call to the OpenShift service. If your domain contains an application, you will not be able to delete the domain. Instead, you will get an error message:

$ rhc delete-domain --namespace testosbook
Deleting domain 'testosbook' ... Domain contains applications. Delete applications first or set force to true.

Therefore, to delete a domain with an application, you have to pass a –force flag. This will delete the domain and all the applications associated with it.

There's more…

The OpenShift web console also allows you to delete members from a domain. Go to https://openshift.redhat.com/app/console/domain/{domain-name} and replace {domain-name} with the domain name in which you want to delete a member. Click on the Delete this domain… button to delete it. This is shown in the following screenshot:

See also

  • The Renaming a domain using rhc recipe