Chapter 5. Removing a RHOSO deployment from the RHOCP environment
You can remove a Red Hat OpenStack Services on OpenShift (RHOSO) deployment from the Red Hat OpenShift Container Platform (RHOCP) environment if you no longer require the RHOSO deployment. You can also remove any Operators that were installed on your RHOCP cluster for use only by the RHOSO deployment.
To create a new RHOSO deployment with the same data plane nodes after RHOSO is removed from the RHOCP environment, you must reprovision the nodes.
5.1. Removing RHOSO resources from the RHOCP environment Copy linkLink copied to clipboard!
You can remove the resources created for your Red Hat OpenStack Services on OpenShift (RHOSO) deployment from the Red Hat OpenShift Container Platform (RHOCP) environment if you no longer require the RHOSO deployment.
Prerequisites
-
You are logged on to a workstation that has access to the Red Hat OpenShift Container Platform (RHOCP) cluster as a user with
cluster-adminprivileges.
Procedure
Delete all the
OpenStackDataPlaneDeploymentobjects in the RHOSO namespace:$ oc delete OpenStackDataPlaneDeployment --all -n openstackDelete all the
OpenStackDataPlaneNodeSetobjects in the RHOSO namespace:$ oc delete OpenStackDataPlaneNodeSet --all -n openstackDelete all the
OpenStackDataPlaneServiceobjects in the RHOSO namespace:$ oc delete OpenStackDataPlaneService --all -n openstackDelete the
OpenStackControlPlaneobject from the RHOSO namespace:$ oc delete openstackcontrolplane \ -l core.openstack.org/openstackcontrolplane -n openstackConfirm that all the deployment pods are deleted:
$ oc get pods -n openstackOptional: Delete all Persistent Volume Claims (PVCs) from the RHOSO namespace:
$ oc delete --all PersistentVolumeClaim -n openstackTipCreate a backup of your PVCs before deletion if you need to reuse them. For information about how to create a PVC backup, see the documentation for the storage backend used in your RHOSO environment.
Optional: Release the PV to make it available for other applications:
$ oc patch PersistentVolume <pv_name> -p '{"spec":{"claimRef": null}}'NoteIf you intend to re-use the released PV, ensure that the PV is cleaned before use. For more information, see Lifecycle of a volume and claim in the RHOCP Storage guide.
Delete the
Secretobjects that contain the certificates issued for the control plane services and the data plane nodes when the RHOSO environment was deployed:$ oc delete secret -l service-cert -n openstack $ oc delete secret -l ca-cert -n openstack $ oc delete secret -l osdp-service -n openstackIf the above commands return the message "No resources found" then the certificate secrets were automatically deleted when you deleted the control plane and data plane resources. For information about configuring the cert-manager Operator before RHOSO deployment to automatically delete the certificate secrets, see Deleting a TLS secret automatically upon Certificate removal in the RHOCP Security and Compliance guide.
Verify that the resources have been deleted from the namespace:
$ oc get all No resources found.Optional: Delete the namespace:
$ oc delete namespace openstackNoteYou do not need to delete the namespace if you plan to create a new RHOSO deployment in the same namespace.
If deleting the namespace is stuck in the terminating state:
Check if any remaining objects have a finalizer:
$ oc get $(oc api-resources|grep openstack.org|cut -d" " -f1 |paste -sd "," -),all -o custom-columns=Kind:.kind,Name:.metadata.name,Finalizers:.metadata.finalizers -n <namespace>Repeat the following command for each remaining object to remove the object finalizers and unblock deletion of each object:
$ oc patch -n <namespace> <object-name> -p '{"metadata":{"finalizers":[]}}' --type=merge
5.2. Removing RHOSO Operators from the RHOCP cluster Copy linkLink copied to clipboard!
You can remove any Operators that were installed on your Red Hat OpenShift Container Platform (RHOCP) cluster for use only by the Red Hat OpenStack Services on OpenShift (RHOSO) deployment. For more information about how to remove an Operator and uninstall all the resources associated with the Operator, see Deleting Operators from a cluster in the RHOCP Operators guide.