Uninstalling Watson Knowledge Catalog

A project administrator can uninstall Watson Knowledge Catalog.

What permissions do you need to complete this task?
You must be an administrator of the project where Watson Knowledge Catalog is installed. When uninstalling on IBM Cloud Pak® for Data 4.5.3 or later, this project is identified by the ${PROJECT_CPD_INSTANCE} environment variable.
To uninstall the Watson Knowledge Catalog operators on IBM Cloud Pak for Data 4.5.3 or later, you must be an administrator of the project where the Cloud Pak for Data operators are installed. This project is identified by the ${PROJECT_CPD_OPS} environment variable.

Information you need to complete this task

Review the following information before you uninstall Watson Knowledge Catalog:

Environment variables
The commands in this task use environment variables so that you can run the commands exactly as written.
  • If you don't have the script that defines the environment variables, see Setting up installation environment variables.
  • To use the environment variables from the script, you must source the environment variables before you run the commands in this task, for example:
    source ./cpd_vars.sh
Installation location
Watson Knowledge Catalog is installed in the same project (namespace) as the Cloud Pak for Data control plane. This project is identified by the ${PROJECT_CPD_INSTANCE} environment variable.

Procedure

Complete the following tasks to uninstall Watson Knowledge Catalog:

  1. Logging in to the cluster
  2. Uninstalling the service
  3. Uninstalling the operator

Logging in to the cluster

To run cpd-cli manage commands, you must log in to the cluster.

To log in to the cluster:

  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.

Uninstalling the service

Who needs to complete this task?
You must be an administrator of the project where Watson Knowledge Catalog is installed.
When do you need to complete this task?
Complete this task if you want to remove Watson Knowledge Catalog from your deployment.

If you installed Watson Knowledge Catalog in multiple projects, you must complete this task for each instance of Watson Knowledge Catalog that you want to uninstall.

To uninstall the service:

  1. Delete the custom resource for Watson Knowledge Catalog.
    cpd-cli manage delete-cr \
    --components=wkc \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}

Uninstalling the operator

Who needs to complete this task?
You must be an administrator with the appropriate permissions to manage OLM objects.
When do you need to complete this task?
Complete this task only if you want to completely remove the Watson Knowledge Catalog software from the cluster.

To uninstall the operator and other OLM objects:

  1. Delete the OLM objects for Watson Knowledge Catalog:
    cpd-cli manage delete-olm-artifacts \
    --cpd_operator_ns=${PROJECT_CPD_OPS} \
    --components=wkc
    • If the command succeeds, it returns [SUCCESS]... The delete-olm-artifacts command ran successfully.
    • If the command fails, it returns [ERROR] and includes information about the cause of the failure.
  2. Ensure that there are no persistent volume claims (PVCs) in a terminating state by running the following command:
    oc get pvc -n <cpd project> | grep Terminating
  3. If there are PVCs that are in a terminating state, for example c-db2oltp-iis-meta or c-db2oltp-wkc-meta, patch the PVCs by running the following command:
    oc patch pvc <pvc name> -n <cpd project> -p '{"metadata":{"finalizers": []}}' --type=merge
  4. If there are Db2 clusters that still exist, then delete them by running the following:
    oc get db2uclusters -n <cpd project>
    oc delete db2uclusters db2oltp-wkc -n <cpd project>
    oc delete db2uclusters db2oltp-iis -n <cpd project>
  5. Delete the wkc-db2u-init job, if it is not running, using the following:
    oc get job -n <cpd project> | grep wkc-db2u-init
    oc delete job wkc-db2u-init -n <cpd project>
  6. If the c-db2oltp-iis-db2u and c-db2oltp-wkc-db2u stateful sets (sts) exists, delete them using the following:
    oc delete sts c-db2oltp-iis-db2u -n <cpd project>
    oc delete sts c-db2oltp-wkc-db2u -n <cpd project>