Uninstalling IBM Concert Operate on OpenShift

These instructions can be used to uninstall an online or offline (airgap) deployment of IBM Concert Operate, and to clean up the resources that it created.

  1. Uninstall IBM Concert Operate
  2. (Optional) Delete the IBM Concert Operate catalog
  3. (Optional) Delete the Cert Manager
  4. (Optional) Delete the remaining CRDs

Before you begin

The Red Hat OpenShift Container Platform command line interface (oc) must be installed on your Red Hat OpenShift Container Platform cluster, and you must be logged in with oc login.

Important: If you installed IBM Concert Operate with GitOps and you configured automatic synchronization, then you must disable automatic synchronization before you uninstall IBM Concert Operate. In the Argo CD user interface, select the Red Hat OpenShift application. Click Application Settings for all the IBM Concert Operate Argo CD applications and disable Auto-Sync to prevent automatic reconciliation during uninstall.

1. Uninstall IBM Concert Operate

  1. Export an environment variable for the IBM Concert Operate project that you want to uninstall.
    Important: If multiple instances of IBM Concert Operate deployed in the same Red Hat OpenShift cluster, then you must set PROJECT_CP4AIOPS to the namespace of the instance that you want to remove. For more information about multiple instances, see Deploying multiple instances.
    export PROJECT_CP4AIOPS=<project>
    

    Where <project> is the namespace (project) that IBM Concert Operate is deployed in.

  2. Export an environment variable for the name of the IBM Concert Operate installation that you want to uninstall.

    export INSTALLATION_NAME="$(oc get installation.orchestrator.aiops.ibm.com -n ${PROJECT_CP4AIOPS} -o jsonpath="{.items[0].metadata.name}")"
  3. Run the delete command to uninstall IBM Concert Operate.
    Warning: This command also automatically deletes all persistent volume claims (PVCs). If you want to preserve your data, you must backup your PVCs before you run it.
    oc delete installation ${INSTALLATION_NAME} -n ${PROJECT_CP4AIOPS}
  4. Verify that the uninstall is progressing by checking for remaining resources.

    oc get csv,subscription,pod -n ${PROJECT_CP4AIOPS}
  5. If resources remain in a pending or stuck state, clean them up manually.

    Remove pending CSV:

    CSV_NAME=$(oc get csv -n ${PROJECT_CP4AIOPS} --no-headers | grep ibm-aiops-orchestrator | awk '{print $1}')
    oc delete csv ${CSV_NAME} -n ${PROJECT_CP4AIOPS}

    Remove subscription:

    oc delete subscription ibm-aiops-orchestrator -n ${PROJECT_CP4AIOPS}

    Remove controller manager pod:

    oc delete pod -l app.kubernetes.io/name=ibm-aiops-orchestrator-controller-manager -n ${PROJECT_CP4AIOPS}
  6. If resources are stuck and will not delete, remove their finalizers (only if uninstall is stuck and resources are pending):

    # For CSV
    CSV_NAME=$(oc get csv -n ${PROJECT_CP4AIOPS} --no-headers | grep ibm-aiops-orchestrator | awk '{print $1}')
    oc patch csv ${CSV_NAME} -n ${PROJECT_CP4AIOPS} --type json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
    
    # For Subscription
    oc patch subscription ibm-aiops-orchestrator -n ${PROJECT_CP4AIOPS} --type json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'

2. (Optional) Delete the IBM Concert Operate catalog

If you have an online deployment and do not require the IBM Concert Operate catalog ibm-aiops-catalog, then use the following steps to remove it.

  1. Run the following command to remove the catalog:
    oc delete catalogsource -n ${PROJECT_CP4AIOPS} ibm-aiops-catalog
  2. Verify that the following command doesn't return the catalog that you removed:
    oc get catalogsource -n ${PROJECT_CP4AIOPS}

If the uninstallation fails, or is not complete and is not progressing, then see Troubleshooting installation and upgrade to help you identify any problems.

3. (Optional) Delete Cert Manager

If you installed the IBM Cloud Pak foundational services Cert Manager, and no other IBM Cloud Paks are using it, then you can remove it.

Important: Cert Manager must not be removed if there are other instances of IBM Concert Operate in the same Red Hat OpenShift cluster, or if IBM Infrastructure Automation is installed on the same cluster.
  1. Follow the instructions in Manual steps for uninstalling singleton services - Cert Manager Opens in a new tab in the IBM Cloud Pak foundational services documentation.

  2. If you have an air-gapped deployment, remove the IBM Cloud Pak foundational services Cert Manager catalog.

    oc delete catsrc -n openshift-marketplace "ibm-cert-manager-catalog"  --ignore-not-found

4. (Optional) Delete the remaining CRDs

When the uninstall of IBM Concert Operate is complete, you can optionally delete the IBM Concert Operate Custom Resource Definitions (CRDs).

Important: Do not delete the CRDs if there are other IBM Concert Operate instances on your cluster, or there are other IBM Cloud Paks or components on the cluster that depend on these definitions. Removing CRDs prematurely can impact other deployments or shared IBM Cloud Pak foundational services.
  1. Download the CRD cleanup script from github.com/IBMOpens in a new tab .

  2. Run the CRD cleanup script to remove IBM Concert Operate related CRDs.

    ./remove-crds.sh

    The script might detect leftover instances of shared resources. These CRDs can be safely deleted if they are not being used by another IBM Cloud Pak or component. For example,

    • IBM Cloud Pak foundational services might be shared with another IBM Cloud Pak or component.
    • An ASMFormation instance might be deployed and used by IBM Netcool Operations Insight.