Chapter 12. Uninstalling Red Hat OpenShift AI Self-Managed
Chapter 12. Uninstalling Red Hat OpenShift AI Self-Managed This section shows how to use the OpenShift command-line interface (CLI) to uninstall the Red Hat OpenShift AI Operator and any OpenShift AI components installed and managed by the Operator. Note Using the CLI is the recommended way to uninstall the Operator. Depending on your version of OpenShift, using the web console to perform the uninstallation might not prompt you to uninstall all associated components. This could leave you unclear about the final state of your cluster. 12.1. Understanding the uninstallation process Installing Red Hat OpenShift AI created several custom resource instances on your OpenShift cluster for various components of OpenShift AI. After installation, users likely created several additional resources while using OpenShift AI. Uninstalling OpenShift AI removes the resources that were created by the Operator, but retains the resources created by users to prevent inadvertently deleting information you might want. What is deleted Uninstalling OpenShift AI removes the following resources from your OpenShift cluster: DataScienceCluster custom resource instance and the custom resource instances it created for each component DSCInitialization custom resource instance Auth custom resource instance created during or after installation FeatureTracker custom resource instances created during or after installation ServiceMesh custom resource instance created by the Operator during or after installation KNativeServing custom resource instance created by the Operator during or after installation redhat-ods-applications , redhat-ods-monitoring , and rhods-notebooks namespaces created by the Operator Workloads in the rhods-notebooks namespace Subscription , ClusterServiceVersion , and InstallPlan objects KfDef object (version 1 Operator only) What might remain Uninstalling OpenShift AI retains the following resources in your OpenShift cluster: Data science projects created by users Custom resource instances created by users Custom resource definitions (CRDs) created by users or by the Operator While these resources might still remain in your OpenShift cluster, they are not functional. After uninstalling, Red Hat recommends that you review the data science projects and custom resources in your OpenShift cluster and delete anything no longer in use to prevent potential issues, such as pipelines that cannot run, notebooks that cannot be undeployed, or models that cannot be undeployed. Additional resources Operator Lifecycle Manager (OLM) uninstall documentation 12.2. Uninstalling OpenShift AI 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 AI Operator and any OpenShift AI components installed and managed by the Operator. Prerequisites You have cluster administrator privileges for your OpenShift 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 cluster as a cluster administrator, as shown in the following example: Create a ConfigMap object for deletion of the Red Hat OpenShift AI Operator. To delete the rhods-operator , set the addon-managed-odh-delete label to true . 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. Wait until the redhat-ods-applications project has been deleted. When the redhat-ods-applications project has been deleted, you see the following output. When the redhat-ods-applications project has been deleted, delete the redhat-ods-operator project. Verification Confirm that the rhods-operator subscription no longer exists. Confirm that the following projects no longer exist. redhat-ods-applications redhat-ods-monitoring redhat-ods-operator rhods-notebooks Note The rhods-notebooks project was created only if you installed the workbenches component of OpenShift AI. See Installing and managing Red Hat OpenShift AI components .
oc login <openshift_cluster_url> -u system:admin oc create configmap delete-self-managed-odh -n redhat-ods-operator oc label configmap/delete-self-managed-odh api.openshift.com/addon-managed-odh-delete=true -n redhat-ods-operator PROJECT_NAME=redhat-ods-applications while oc get project USDPROJECT_NAME &> /dev/null; do echo "The USDPROJECT_NAME project still exists" sleep 1 done echo "The USDPROJECT_NAME project no longer exists" The redhat-ods-applications project no longer exists oc delete namespace redhat-ods-operator oc get subscriptions --all-namespaces | grep rhods-operator oc get namespaces | grep -e redhat-ods* -e rhods*