Uninstalling the components

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

Who needs to complete this task?
A user with the appropriate permissions to manage projects must complete this task.
When do you need to complete this task?
Complete this task only if you want to 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.

About this task

If you plan to uninstall the Cloud Pak for Data operators, you must uninstall all instances of Cloud Pak for Data before you uninstall the operators.

Use the cpd-cli manage delete-cr command to remove the custom resources.

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 Cloud Pak for Data components:

  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 get-cr-status \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
  3. Set the COMPONENTS environment variable to include the components that were returned by the get-cr-status command:
    export COMPONENTS=<components>
  4. Delete the custom resources for the specified components in the project.
    cpd-cli manage delete-cr \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
    --components=${COMPONENTS}
    Tip: If you want to preview the oc commands that the cpd-cli manage delete-cr will issue on your behalf, you can run the command with --preview=true.

    The oc commands are saved to the preview.sh file in the cpd-cli-workspace/olm-utils-workspace/work directory.

  5. Re-run get-cr-status to confirm that all of the components were removed:
    cpd-cli manage get-cr-status \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
  6. Clean up any remaining resources in the project:
    1. Set the RESOURCE_LIST environment variable:
      export RESOURCE_LIST=configmaps,persistentvolumeclaims,pods,secret,serviceaccounts,Service,StatefulSets,deployment,job,cronjob,ReplicaSet,Route,RoleBinding,Role,PodDisruptionBudget,OperandRequest
    2. Run the following command to identify any remaining resources in the PROJECT_CPD_INSTANCE project:
      oc get ${RESOURCE_LIST} -n ${PROJECT_CPD_INSTANCE} --ignore-not-found
    3. Delete any resources that are returned.
      The format of the command is:
      oc delete <object-type> <object-name>
  7. Remove the PROJECT_CPD_INSTANCE project:
    oc delete project PROJECT_CPD_INSTANCE

Results

The components are uninstalled from the ${PROJECT_CPD_INSTANCE} project.

What to do next

If you want to completely remove the Cloud Pak for Data software from your cluster, you must complete Uninstalling the OLM objects.