Uninstalling Watson Knowledge Studio
An instance administrator can uninstall Watson Knowledge Studio.
- Who needs to complete this task?
-
Instance administrator To uninstall Watson Knowledge Studio, you must be an instance administrator. An instance administrator has permission to manage software in the following projects:
- The operators project for the instance
-
The operators for this instance of Cloud Pak for Data are installed in the operators project. In the uninstall commands, the
${PROJECT_CPD_INST_OPERATORS}
environment variable refers to the operators project. - The operands project for the instance
-
The Cloud Pak for Data control plane and the services for this instance of Cloud Pak for Data are installed in the operands project. In the uninstall commands, the
${PROJECT_CPD_INST_OPERANDS}
environment variable refers to the operands project.
- When do you need to complete this task?
-
Complete this task if you want to remove Watson Knowledge Studio from an instance of Cloud Pak for Data.
Repeat as needed If you are responsible for multiple instances of Cloud Pak for Data, you can repeat this task to remove other instances of Watson Knowledge Studio on the cluster.
Information you need to complete this task
Review the following information before you uninstall Watson Knowledge Studio:
- 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,
run:
source ./cpd_vars.sh
Procedure
Complete the following tasks to uninstall Watson Knowledge Studio:
Logging in
-
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: Thelogin-to-ocp
command takes the same input as theoc login
command. Runoc login --help
for details.
Uninstalling the service
- Create an environment variable named
OPERAND_NAME
to store the operand name for Watson Knowledge Studio.oc get KnowledgeStudio --namespace ${PROJECT_CPD_INST_OPERANDS} export OPERAND_NAME=<operand_name>
- Use the following commands to uninstall the service and its associated
resources:
oc delete KnowledgeStudio wks oc delete pvc -l 'release in (wks,wks-minio,wks-ibm-watson-ks)' oc delete pvc wks-minio-ibm-minio-backup-pvc oc delete secret -l 'release in (wks,wks-minio,wks-ibm-watson-ks)'
Uninstalling the operator
- Delete the OLM objects for Watson Knowledge Studio:
cpd-cli manage delete-olm-artifacts \ --cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \ --components=watson_ks
- 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.
Removing associated resources
- Remove Watson Knowledge Studio data from Multicloud Object Gateway.Important: This procedure deletes the data for all installations of Watson Knowledge Studio in all projects (namespaces) on the cluster. You cannot delete data from Multicloud Object Gateway on a per-project basis. Ensure that all Watson Knowledge Studio projects were uninstalled from the cluster before you complete this procedure.
-
Download the MinIO client.
Refer to the MinIO product documentation and follow the appropriate instructions for your platform.
- Get the
host
andport
information for the Multicloud Object Gateway and store it in an environment variable namedMCG_ENDPOINT
by entering the following command:export MCG_ENDPOINT="$(oc get route s3 --namespace openshift-storage \ --output jsonpath='https://{.spec.host}')"
-
Get the access key and secret key of Multicloud Object Gateway from the
noobaa-account-watson-ks
secret and store the keys in environment variables.export MCG_ACCESS_KEY="$(oc extract secret/noobaa-account-watson-ks \ --keys=AWS_ACCESS_KEY_ID --to=- --namespace ${PROJECT_CPD_INST_OPERANDS})"
export MCG_SECRET_KEY="$(oc extract secret/noobaa-account-watson-ks \ --keys=AWS_SECRET_ACCESS_KEY --to=- --namespace \ ${PROJECT_CPD_INST_OPERANDS})"
- Configure the MinIO client for Multicloud Object Gateway.
mc alias set wks "${MCG_ENDPOINT}" "${MCG_ACCESS_KEY}" "${MCG_SECRET_KEY}"
Note: If necessary, follow the instructions in the MinIO documentation to configure a security certificate. Otherwise, specify the--insecure
option to disable certificate verification. If you disable verification for the client, you must include the--insecure
option when you submit themc
commands. -
Run the following command to confirm that the MinIO client is successfully configured. The command lists the buckets that are used by Watson Knowledge Studio.
If an error is displayed, check the variables that you defined in the previous steps and ensure that the Multicloud Object Gateway host and port are accessible from your console.mc ls wks
- Delete the following objects and buckets that were created by Watson Knowledge Studio:
wks-icp
mc rm --recursive --force wks/wks-icp mc rb wks/wks-icp
- Remove the Multicloud Object Gateway configuration from the
MinIO client by entering the following
command:
mc alias remove wks
-
- 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 noobaa-account-watson-ks noobaa-cert-watson-ks noobaa-uri-watson-ks
- If any resources are listed, delete them by running the following command for each resource one
at a
time:
oc delete secret {secret-name}