Option 1: Uninstalling BAI from the OCP console

You can uninstall IBM Business Automation Insights resources from your platform deployment from the OpenShift Container Platform (OCP) console.

About this task

If you installed the BAI catalogs, and used IBM Business Automation Insights operator to create an InsightsEngine instance then you can use the OCP user interface to uninstall it. Uninstalling and cleaning up the cluster involves several separate high-level tasks.

  • Uninstalling the BAI deployment.
  • Uninstalling the operators.
  • Deleting PVs and PVCs. If you do delete the PVs and PVCs, the persistent data along with configuration and log files are also deleted. Delete the PVCs before you delete the PVs
  • Deleting the secrets created by the BAI deployment. Go to the BAI project, click Workloads > Secrets, then right-click each secret and click Delete secret.

    If you do delete all of the secrets that you created for IBM Business Automation Insights, then you must create them again if you want to install another BAI deployment.

  • Deleting the BAI project.
  • Uninstalling the Cloud Pak foundational services is necessary only if you want to completely clean up the cluster. The uninstallation of BAI uninstalls Cloud Pak foundation services only and does not remove the Cloud Pak foundation services operators and some of its resources. To completely remove Cloud Pak foundational services, see Uninstalling foundational services.

To uninstall the BAI deployment, use the following steps.

Procedure

  1. Log in to your OCP or ROKS cluster.
  2. Click Administration > Namespaces, and click the namespace that you used to install the BAI deployment.
  3. Click Operators > Installed Operators > IBM Business Automation Insights, and then click the BAI deployment tab.

    The name of the deployment is shown in the list of InsightsEngines. The default name is bai.

  4. To the right of the InsightsEngines name, click ellipsis > Delete InsightsEngines.
    Delete InsightsEngine

    The action deletes the resources and the instance is no longer seen in the InsightsEngines list.

    Wait for all the pods in the BAI namespace to be terminated, except the operator pods, before you go to the next step.

  5. Optional: If you want to uninstall the IBM Business Automation Insights operator as well, then click Operators > Installed Operators. To the right of the IBM Business Automation Insights operator, click ellipsis > Uninstall Operator.

    The action deletes the operator and the instance is no longer seen in the Installed Operators list.

    Note: Deleting the InsightsEngines and uninstalling the BAI operator does not delete the existing PVs and PVC that are used by the various components. Check the persisted data before you delete the PVs and PVCs manually to make sure that you no longer want to keep them. Likewise, if the data no longer needs to be retained or reused you can delete the databases.

What to do next

If you now plan to install another instance of the IBM Business Automation Insights on the same cluster, check if the dependencies like Namespaces and OperandRequests are properly deleted. If you are sharing the project with another Business Automation Insights, then do not delete the dependencies.

Deleting PVCs

If you uninstalled all the operators, then you can delete the PVCs from the project. Click Storage > PersistentVolumeClaims for each PVC, and then click Delete PersistentVolumeClaim. Change the "Filter" to Label and enter "app=ibm-insights-engine. You can then delete the listed PVCs by clicking Actions > Delete PersistentVolumeClaim.

Deleting secrets
  1. Remove the foundation subscription in the BAI namespace by clicking Home > Search, selecting Subscription for operators.coreos.com/v1alpha1 in the Resource list, and then selecting Remove Subscription from the ibm-bai-foundation-operator menu. Now, all of the BAI secrets can be deleted.
  2. To delete the secrets from the project click Workloads > Secrets, and then click Delete Secret.

    The BAI secrets include the strings ibm-bai or insightsengine in the names. The custom secrets can also be deleted, for example ldap-bind-secret.

Uninstall foundational services
Note: If you plan to clean up your Business Automation Insights and Cloud Pak foundational services namespaces after you uninstall the foundational services, then do not delete the Cloud Pak foundational services namespace and the common-service-maps ConfigMap in kube-public namespace. The Cloud Pak foundational services and the common-service-maps ConfigMap in kube-public namespace are required when you run the bai-clean-up.sh script.

If you want to uninstall the Cert Manager from Cloud Pak foundational services, see Manual steps for uninstalling singleton services - Cert Manager. If your IBM Cert Manager was installed in the ibm-cert-manager namespace, you can delete the namespace.

If you want to uninstall the License Service from Cloud Pak foundational services, see Uninstalling License Service. If your License Manager was installed in the ibm-licensing namespace, you can delete the namespace.

For more information about uninstalling foundational services, see Uninstalling foundational services.

Note: You can also run a script if the foundational services uninstallation does not remove all the components. For more information, see Uninstallation is not successful.
Cleaning up your Business Automation Insights and Cloud Pak foundational services namespaces

You can use the bai-clean-up.sh script to remove any resources left behind after uninstallation. The script ensures that all resources from the Business Automation Insights and Cloud Pak foundational services namespaces are properly cleaned up. If a namespace is not fully cleaned, you might be unable to delete it, or some resources may reappear if you reuse the same namespace name. If your Cloud Pak foundational services are not shared with other Cloud Paks, you can clean up both the Business Automation Insights and Cloud Pak foundational services namespaces.

Run the script if any of the following are true:
  • The BAI namespace is not deleted.
  • The common-service-maps ConfigMap in kube-public namespace is not deleted.
  1. Change the directory to the scripts folder under cert-kubernetes-bai/scripts.
    cd /<path_to_cert-kubernetes-bai>/cert-kubernetes-bai/scripts

    Where <path_to_cert-kubernetes-bai> is the path to cert-kubernetes-bai.

  2. Run the bai-clean-up.sh script to clean up the Business Automation Insights and Cloud Pak foundational services namespaces.
    ./bai-clean-up.sh -n <bai-ns>

    Where <bai-ns> is the target namespace.

Important: If you installed your BAI deployment with separation of duties, make sure that you use the namespace that contains the BAI deployment and not the BAI operators namespace. If you do not specify a namespace, the script asks you to enter the services namespace.
The script performs the following actions:
  • It checks whether the Cloud Pak foundational services associated with Business Automation Insights are shared. If they are shared, the script cleans only the Business Automation Insights namespace.
  • It detects whether the deployment uses separation of duties—where the Business Automation Insights operators and the Business Automation Insights instance are in different namespaces. If so, the script cleans both the Business Automation Insights and Cloud Pak foundational services namespaces.
  • It asks whether you have multiple Business Automation Insights deployments on the same cluster. If you select Yes, the related custom resource definitions (CRDs) are preserved. If you select No, those CRDs are deleted.
  • It displays the list of resources in each namespace that will be deleted. You must confirm whether to proceed with cleaning up both the Business Automation Insights and Cloud Pak foundational services namespaces, including deleting the namespace where the Business Automation Insights instance is installed.
Deleting the BAI project
Note: If deleting a project fails and the project is stuck in the Terminating state, some objects may still exist in the namespace after a force deletion. Do not use the same project name to rebuild instead use a new project name.

Click Home > Projects, identify the project, and then click Delete Project.

The project might not terminate successfully until you uninstall the Cloud Pak foundational services.

Note: If foundational services are installed in a namespace-scoped instance in the same namespace as the BAI deployment, then delete the BAI project after you uninstalled the foundational services. For more information, see Install foundational services.
Deleting the catalog sources
If you decide to remove BAI completely, then remove the related catalog sources.
  1. Click Administration > Cluster Settings, click the Configuration tab, scroll down the list, and then click OperatorHub.
  2. Select the Sources tab.
  3. Delete the following sources:
    • ibm-bai-operator-catalog
    • bts-operator
    • cloud-native-postgresql-catalog
    • ibm-cert-manager-catalog
    • ibm-cs-install-catalog-v4-6-2
    • ibm-cs-opensearch-catalog
    • ibm-events-operator-catalog
    • ibm-iam-operator-catalog
    • ibm-licensing-catalog
    • ibm-opencontent-flink
    • ibm-zen-operator-catalog
Optional: Deleting custom resource definitions
If you plan to remove all the Cloud Pak dependencies, the custom resource definitions (CRD) for Business Automation Insights can be deleted.
Note: Do not delete the custom resource definitions if you have other Business Automation Insights deployment on the cluster.

Click Administration > CustomResourceDefinitions, search by the name and click Delete CustomResourceDefinition.

Delete the following CRDs from the cluster.
insightsengines.bai.ibm.com
foundations.bai.ibm.com