Uninstalling an instance of IBM Cloud Pak for Data

If you want to uninstall an instance of IBM Cloud Pak for Data, you must uninstall the running instance of the control plane and services and the operators associated with the instance.

Who needs to complete this task?

Instance administrator An instance administrator can complete this task.

When do you need to complete this task?
Complete this task only if you want to completely uninstall IBM Cloud Pak for Data.

If you installed multiple instances of Cloud Pak for Data on the cluster, you must complete this task for each instance of Cloud Pak for Data that you want to uninstall.

Before you begin

Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

  1. If there are any projects tethered to this instance of Cloud Pak for Data, complete Untethering projects from the Cloud Pak for Data control plane before you uninstall the instance.
  2. Ensure that you are running olm-utils-v2:4.7.2 or later.
    Run the following command when your workstation is connected to the internet to download the latest version of the olm-utils-v2 image:
    cpd-cli manage restart-container

About this task

Use the cpd-cli manage delete-cr command to remove the custom resources and the cpd-cli manage delete-olm-artifacts command to remove the operators.

The instructions assume that you are removing all of the components at the same time, which enables you to complete the task in fewer steps.

Procedure

To uninstall an instance of Cloud Pak for Data:

  1. Run the cpd-cli manage login-to-ocp command to log in to the cluster as a user with sufficient permissions to complete this task. For example:
    cpd-cli manage login-to-ocp \
    --username=${OCP_USERNAME} \
    --password=${OCP_PASSWORD} \
    --server=${OCP_URL}
    Tip: The login-to-ocp command takes the same input as the oc login command. Run oc login --help for details.
  2. Determine which components are installed in the project:
    cpd-cli manage list-deployed-components \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
  3. Set the COMPONENTS environment variable to include the components that were returned by the list-deployed-components command:
    export COMPONENTS=<components>
  4. Delete the custom resources for the specified components in the project.
    Tip: Before you run this command against your cluster, you can preview the oc commands that this command will issue on your behalf by running the command with the --preview=true option.

    The oc commands are saved to the preview.sh file in the work directory.

    cpd-cli manage delete-cr \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
    --components=${COMPONENTS} \
    --include_dependency=true
  5. Run get-cr-status to confirm that all of the components were removed:
    cpd-cli manage get-cr-status \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
  6. Uninstall the operators for the instance:
    cpd-cli manage delete-olm-artifacts \
    --cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
    --delete_all_components=true
  7. Check whether the projects for the instance still exist:
    1. Check whether the operands project still exists:
      oc get project ${PROJECT_CPD_INST_OPERANDS}
      • If the project does not exist, the command returns the following message: Error from server (Not Found)
      • If the project still exists, the command returns information about the project.
    2. If the project still exists, delete it:
      oc delete project ${PROJECT_CPD_INST_OPERANDS}
    3. Check whether the operators project still exists:
      oc get project ${PROJECT_CPD_INST_OPERATORS}
      • If the project does not exist, the command returns the following message: Error from server (Not Found)
      • If the project still exists, the command returns information about the project.
    4. If the project still exists, delete it:
      oc delete project ${PROJECT_CPD_INST_OPERATORS}