Uninstalling Watson Discovery

A project administrator can uninstall Watson Discovery from IBM® Cloud Pak for Data.

Before you begin

Required role: To complete this task, you must be an administrator of the project (namespace) where Watson Discovery is installed.

Before you uninstall Watson Discovery, ensure that the machine from which you will run the commands meets the following requirements:

  • Can connect to the cluster.
  • Has the oc command-line interface.
  • Has the Cloud Pak for Data command-line interface.
  • Has a cpd-cli profile. Ensure that the profile points to the instance of Cloud Pak for Data where Watson Discovery is installed. For details, see Creating a cpd-cli profile.

Removing Watson Discovery will remove all of the data that is associated with this instance of Watson Discovery.

Tip: For a list of all available options, enter the following command:
./cpd-cli uninstall --help

Procedure

From your installation node:

  1. From the web client, remove any provisioned instances of Watson Discovery:
    1. Log in to the Cloud Pak for Data web client as an administrator.
    2. From the menu, select Services > Instances.
    3. Filter the list to show only watson-discovery service instances.
    4. Delete all of the instances of the service.
  2. Change to the directory where you placed the Cloud Pak for Data command-line interface.
  3. Log in to your Red Hat® OpenShift® cluster as a project administrator:
    oc login OpenShift_URL:port
  4. Run the following command to ensure that there are no remaining Watson Discovery service instances in the project where Watson Discovery is deployed:
    ./cpd-cli service-instance list\
    --service-type discovery \
    --profile Profile_name \
    Replace Profile_name with the name of your local profile. For details, see Creating a cpd-cli profile.
    Important: To ensure that the command returns all of the service instances, the profile must be associated with a Cloud Pak for Data user who has one of the following permissions:
    • Administer platform
    • Manage and monitor platform
  5. Run the following command to preview the changes that will be made to the cluster when you remove Watson Discovery:
    ./cpd-cli uninstall \
    --assembly watson-discovery \ 
    --namespace Project \
    --include-dependent-assemblies \ 
    --profile Profile_name
    --dry-run

    Replace the following values:

    Variable Replace with
    Project The Red Hat OpenShift project where Watson Discovery is deployed.
    Profile_name The name of your local profile.
    Important: Review the output of the command to understand what software will be removed.

    The --include-dependent-assemblies flag automatically removes any dependencies that are not required by other services.

    For example, if Watson Discovery is the only service installed on Cloud Pak for Data, this command will uninstall Watson Discovery and the Cloud Pak for Data control plane.

    In this scenario, if you don't want to uninstall the Cloud Pak for Data control plane, you can remove the --include-dependent-assemblies flag from the command.

  6. Rerun the previous command without the --dry-run flag to remove Watson Discovery.
To remove extra resources, complete the following steps:
  1. To remove remaining persistent volume claims, run the following commands:
    oc delete --namespace Project pvc --selector "app.kubernetes.io/name in (wd, discovery)"
    oc delete --namespace Project pvc --selector "etcd_cluster=wd-discovery-etcd"
  2. To remove the PostgreSQL configuration map that was associated with the deployment, run the following command:
    oc delete --namespace Project configmap "stolon-cluster-wd-discovery-postgres"
  3. To remove resources that were added by running the cpd-cli adm command during the installation process, run the following command.
    Note: You will need to redo the steps in Setting up the cluster for Watson Discovery if you reinstall the service later.
    oc delete --namespace Project --selector 'cpd_module=watson-discovery-adm-setup' --ignore-not-found \
        serviceaccount,role,rolebinding,securitycontextconstraints,customresourcedefinition
  4. Only if no other services are using the EnterpriseDB (EDB) PostgreSQL server, you can also remove the EDB operator by running the following command.
    Note: If you include the --include-dependent-assemblies command when you uninstall the Discovery service, everything associated with the service installation is removed, including the EDB resources and even Cloud Pak for Data itself.
    ./cpd-cli uninstall --assembly edb-operator --namespace Project

What to do next