Uninstalling Watson Discovery

A project administrator can uninstall Watson Discovery.

What permissions do you need to complete this task?
The permissions that you need depend on which tasks you must complete:
  • To uninstall Watson Discovery, you must be an administrator of the project where Watson Discovery is installed. This project is identified by the ${PROJECT_CPD_INSTANCE} environment variable.
  • To uninstall the Watson Discovery operators, 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.
When do you need to complete this task?
Complete this task if you want to remove a running instance of Watson Discovery from your environment.

Information you need to complete this task

Review the following information before you uninstall Watson Discovery:

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 Discovery 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 Discovery:

  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 Discovery is installed.
When do you need to complete this task?
Complete this task if you want to remove Watson Discovery from your deployment.

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

To uninstall the service:

  1. Delete the custom resource for Watson Discovery.
    cpd-cli manage delete-cr \
    --components=watson_discovery \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
Complete these extra steps to clean up after the service is removed:
  1. Run the following command to list the resources that were created by Watson Discovery and verify that they are deleted. The -l parameter is a lowercase L that is used to request a list.
    
    oc get all,wdall,role,rolebinding,secret,serviceaccount,rabbitmqcluster,miniocluster,etcdcluster,cluster.postgresql.k8s.enterprisedb.io,\
    watsongateway,modeltrain,certificate,elasticsearchcluster -l 'icpdsupport/addOnId=discovery'

    If Watson Discovery was uninstalled successfully, the response is empty. If it is not, delete any remaining resources by using the oc delete resource-type resource-name command.

  2. Verify that all persistent volume claim (PVC) resources that were created by Watson Discovery are deleted. Run the following commands to list any remaining persistent volume claim (PVC) resources:
    oc get pvc -l 'app.kubernetes.io/name in (wd,discovery)'
    oc get pvc -l 'etcd_cluster=wd-discovery-etcd'
    If any remaining PVC resources are listed, delete them by running the following command for each resource in turn:
    oc delete pvc {pvc-name}
  3. Verify that all secret resources that were created by the service are deleted. Run the following commands to list any remaining resources:
    oc get secret wd-discovery-cert-manager-tls wd-discvery-kes-client-secret
  4. If any resources are listed, delete them by running the following command for each resource one at a time:
    oc delete secret {secret-name}

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 Discovery software from the cluster.

To uninstall the operator and other OLM objects:

  1. Delete the OLM objects for Watson Discovery:
    cpd-cli manage delete-olm-artifacts \
    --cpd_operator_ns=${PROJECT_CPD_OPS} \
    --components=watson_discovery
    • 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.