Chapter 8. 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 Container Platform, 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.

8.1. Understanding the uninstallation process

Installing Red Hat OpenShift AI created several custom resource instances on your OpenShift Container Platform 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 Container Platform cluster:

  • DataScienceCluster custom resource instance
  • DSCInitialization custom resource instance
  • 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 Container Platform 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 Container Platform cluster, they are not functional. After uninstalling, Red Hat recommends that you review the data science projects and custom resources in your OpenShift Container Platform 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.

8.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 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

  1. Open a new terminal window.
  2. 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
  3. Create a ConfigMap object for deletion of the Red Hat OpenShift AI Operator.

    $ oc create configmap delete-self-managed-odh -n redhat-ods-operator
  4. To delete the rhods-operator, set the addon-managed-odh-delete label to true.

    $ oc label configmap/delete-self-managed-odh api.openshift.com/addon-managed-odh-delete=true -n redhat-ods-operator
  5. When all objects associated with the Operator are removed, delete the redhat-ods-operator project.

    1. Set an environment variable for the redhat-ods-applications project.

      $ PROJECT_NAME=redhat-ods-applications
    2. 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
    3. When the redhat-ods-applications project has been deleted, delete the redhat-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*
      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.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.