Chapter 7. Uninstalling CodeReady Workspaces

This section describes uninstallation procedures for Red Hat CodeReady Workspaces installed on OpenShift. The uninstallation process leads to a complete removal of CodeReady Workspaces-related user data. The appropriate uninstallation method depends on what method was used to install the CodeReady Workspaces instance.

7.1. Uninstalling CodeReady Workspaces after OperatorHub installation

Users have two options for uninstalling CodeReady Workspaces from an OpenShift cluster. The following sections describe the following methods:

  • Using the OpenShift Administrator Perspective web UI
  • Using oc commands from the terminal

7.1.1. Uninstalling CodeReady Workspaces using the OpenShift web console

This section describes how to uninstall CodeReady Workspaces from a cluster using the OpenShift Administrator Perspective main menu.

Prerequisites

  • CodeReady Workspaces was installed on an OpenShift cluster using OperatorHub.

Procedure: deleting the CodeReady Workspaces deployment

  1. Open the OpenShift web console.
  2. Navigate to the Operators > Installed Operators section.
  3. Click Red Hat CodeReady Workspaces in the list of installed operators.
  4. Navigate to the Red Hat CodeReady Workspaces Cluster tab.
  5. In the row that displays information about the specific CodeReady Workspaces cluster, delete the CodeReady Workspaces Cluster deployment using the drop-down menu illustrated as three horizontal dots situated on the right side of the screen.
  6. Alternatively, delete the CodeReady Workspaces deployment by clicking the displayed Red Hat CodeReady Workspaces Cluster, red-hat-codeready-workspaces, and select the Delete cluster option in the Actions drop-down menu on the top right.

Procedure: deleting the CodeReady Workspaces Operator

  1. Open the OpenShift web console.
  2. Navigate to the Operators > Installed Operators section in OpenShift Developer Perspective.
  3. In the row that displays information about the specific Red Hat CodeReady Workspaces Operator, uninstall the CodeReady Workspaces Operator using the drop-down menu illustrated as three horizontal dots situated on the right side of the screen.
  4. Accept the selected option, Also completely remove the Operator from the selected namespace.
  5. Alternatively, uninstall the Red Hat CodeReady Workspaces Operator by clicking the displayed Red Hat CodeReady Workspaces Operator, Red Hat CodeReady Workspaces, followed by selecting the Uninstall Operator option in the Actions drop-down menu on the top right.

7.1.2. Uninstalling CodeReady Workspaces using oc commands

This section provides instructions on how to uninstall a CodeReady Workspaces instance using oc commands.

Prerequisites

  • CodeReady Workspaces was installed on an OpenShift cluster using OperatorHub.
  • OpenShift command-line tools (oc) are installed on the local workstation.

Procedure

The following procedure provides command-line outputs as examples. Note that output in the user terminal may differ.

To uninstall a CodeReady Workspaces instance from a cluster:

  1. Sign in to the cluster:

    $ oc login -u <username> -p <password> <cluster_URL>
  2. Switch to the project where the CodeReady Workspaces instance is deployed:

    $ oc project <codeready-workspaces_project>
  3. Obtain the CodeReady Workspaces cluster name. The following shows a cluster named red-hat-codeready-workspaces:

    $ oc get checluster
    NAME          AGE
    red-hat-codeready-workspaces   27m
  4. Delete the CodeReady Workspaces cluster:

    $ oc delete checluster red-hat-codeready-workspaces
    checluster.org.eclipse.che "red-hat-codeready-workspaces" deleted
  5. Obtain the name of the CodeReady Workspaces cluster service version (CSV) module. The following detects a CSV module named red-hat-codeready-workspaces.v2.1:

    $ oc get csv
    NAME                 DISPLAY       VERSION   REPLACES             PHASE
    red-hat-codeready-workspaces.v2.1   Red Hat CodeReady Workspaces   2.1     red-hat-codeready-workspaces.v2.0   Succeeded
  6. Delete the CodeReady Workspaces CSV:

    $ oc delete csv red-hat-codeready-workspaces.v2.1
    clusterserviceversion.operators.coreos.com "red-hat-codeready-workspaces.v2.1" deleted

7.2. Uninstalling CodeReady Workspaces after crwctl installation

This section describes how to uninstall an instance of Red Hat CodeReady Workspaces that was installed using the crwctl tool.

Important
  • For CodeReady Workspaces installed using the crwctl server:start command and the -n argument (custom namespace specified), use the -n argument also to uninstall the CodeReady Workspaces instance.
  • For installations that did not use the -n argument, the created namespace is named workspaces by default.

Prerequisites

  • CodeReady Workspaces was installed on an OpenShift cluster using crwctl.
  • OpenShift command-line tools (oc) and crwctl are installed on the local workstation.
  • The user is logged in a CodeReady Workspaces cluster using oc.

Procedure

  1. Stop the Red Hat CodeReady Workspaces Server:

    $ crwctl server:stop
  2. Obtain the name of the CodeReady Workspaces namespace:

    $ oc get checluster --all-namespaces -o=jsonpath="{.items[*].metadata.namespace}"
  3. Remove CodeReady Workspaces from the cluster:

    $ crwctl server:delete -n <namespace>

    This removes all CodeReady Workspaces installations from the cluster.