Chapter 8. Uninstalling Red Hat OpenShift Data Science self-managed
This section shows how to use the OpenShift command-line interface (CLI) to uninstall the Red Hat OpenShift Data Science Operator and any OpenShift Data Science components installed and managed by the Operator.
Using the CLI is the recommended way to uninstall the Operator. Depending on your version of OpenShift Container Platform, using the web console to perform the uninstallation might not prompt you to uninstall all associated components. This could leave your cluster in an unclear state.
8.1. Uninstalling Red Hat OpenShift Data Science self-managed by using the CLI
The following procedure shows how to use the OpenShift command-line interface (CLI) to uninstall the Red Hat OpenShift Data Science Operator and any OpenShift Data Science components installed and managed by the Operator.
Prerequisites
- You have cluster administrator privileges for your OpenShift Container Platform cluster.
- You have downloaded and installed the OpenShift command-line interface (CLI). See Installing the OpenShift CLI.
- You have backed up the persistent disks or volumes used by your persistent volume claims (PVCs).
Procedure
- Open a new terminal window.
In the OpenShift command-line interface (CLI), log in to your OpenShift Container Platform cluster as a cluster administrator, as shown in the following example:
$ oc login <openshift_cluster_url> -u system:admin
Create a
ConfigMap
object for deletion of the Red Hat OpenShift Data Science Operator.$ oc create configmap delete-self-managed-odh -n redhat-ods-operator
To delete the
rhods-operator
, set theaddon-managed-odh-delete
label totrue
.$ oc label configmap/delete-self-managed-odh api.openshift.com/addon-managed-odh-delete=true -n redhat-ods-operator
When all objects associated with the Operator are removed, delete the
redhat-ods-operator
project.Set an environment variable for the
redhat-ods-applications
project.$ PROJECT_NAME=redhat-ods-applications
Wait until the
redhat-ods-applications
project has been deleted.$ while oc get project $PROJECT_NAME &> /dev/null; do echo "The $PROJECT_NAME project still exists" sleep 1 done echo "The $PROJECT_NAME project no longer exists"
When the
redhat-ods-applications
project has been deleted, you see the following output.The redhat-ods-applications project no longer exists
When the
redhat-ods-applications
project has been deleted, delete theredhat-ods-operator
project.$ oc delete namespace redhat-ods-operator
Verification
Confirm that the
rhods-operator
subscription no longer exists.$ oc get subscriptions --all-namespaces | grep rhods-operator
Confirm that the following projects no longer exist.
-
redhat-ods-applications
-
redhat-ods-monitoring
-
redhat-ods-operator
rhods-notebooks
$ oc get namespaces | grep -e redhat-ods* -e rhods*
NoteThe
rhods-notebooks
project was created only if you installed the workbenches component of OpenShift Data Science. See Installing and managing Red Hat OpenShift Data Science components.
-