Uninstalling IBM Cloud Pak for Multicloud Management

Complete these steps to uninstall the IBM Cloud PakĀ® and its components. When you uninstall the IBM Cloud Pak, the default services are automatically uninstalled. For the list of default services, see Default services.

  1. Uninstall IBM Cloud Pak for Multicloud Management Cloud Native Monitoring from managed clusters
  2. Remove your managed clusters
  3. Uninstall manually deployed operands
  4. Remove the installation instance and objects
  5. Remove the IBM Cloud Pak for Multicloud Management operator
  6. Remove the components
  7. Remove orphaned secrets and custom resources definitions (CRDs)
  8. Optional: Uninstall common services
  9. Optional: Delete the namespaces
  10. Optional: Uninstall Ansible Tower

1. Uninstall IBM Cloud Pak for Multicloud Management Cloud Native Monitoring from managed clusters

If you deployed Cloud Native Monitoring on a managed cluster, you must uninstall Cloud Native Monitoring before you uninstall IBM Cloud Pak for Multicloud Management. For the instructions, refer to Uninstalling Cloud Native Monitoring.

2. Remove your managed clusters

Removing an imported cluster Opens in a new tab

Note: When you remove a managed cluster, the namespace is normally removed as part of the cluster removal process. In rare cases, the namespace remains with some artifacts in it. In that case, you must manually remove the namespace. For more information, see troubleshooting Opens in a new tab.

3. Uninstall manually deployed operands

If you deployed the operands of the following operators in your cluster, you must complete the steps in this section before you uninstall IBM Cloud Pak for Multicloud Management. For more information about the operands, see Deploying operands.

Complete these steps to run a script that removes the components that are installed by these operands.

  1. Log in to your infrastructure node with the oc login command.

  2. Download the script.

    wget https://raw.githubusercontent.com/IBM/cp4mcm-samples/master/scripts/cp4mcm-cleanup-utility.sh
    
  3. Assign executable permission to the script.

    chmod +x cp4mcm-cleanup-utility.sh
    
  4. Run the following commands from the directory where you downloaded the script.

4. Remove the installation instance and objects

  1. Log in to your OpenShift cluster console.
  2. Click Home > Explore.
  3. Type Installation in the Filter by kind text box.
  4. Click Installation.
  5. Switch to the project where you installed the IBM Cloud Pak for Multicloud Management. For example, if you installed the Cloud Pak in the cp4mcm namespace, select cp4mcm from the Project drop-down list.
  6. Select the Instances tab.
  7. Locate your IBM Cloud Pak for Multicloud Management installation instance.
  8. Click the overflow menu icon, and click Delete Installation.

Wait until the installation objects are deleted and the installation instance is removed. This process might take up to 10 minutes.

Verify whether the instance and objects are removed

  1. Log in to your infrastructure node with the oc login command.

  2. Check whether all the IBM Cloud Pak for Multicloud Management-related operand requests are deleted.

    oc get opreq -A
    

    If any operand request is not deleted, you can manually delete it:

    oc delete opreq <operand-request-name> -n <operand-request-namespace>
    
  3. Check whether all the pods, services, daemonsets, deployments, replicasets, statefulsets, jobs, and routes in the IBM Cloud Pak for Multicloud Management-related namespaces are deleted.

    Note: If any resource is not deleted, you can run the following command to remove the resource and its finalizer.

    ./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode anyResourceCleanup --resourceKind <type-of-resource> --resourceName <name-of-the-resource> --resourceNamespace <namespace-where-the-resource-is>
    
  4. Check whether the catalog source is deleted.

    oc get catalogsource -n openshift-marketplace
    

    If you see ibm-management-orchestrator, you must manually delete it. This is the IBM Cloud Pak catalog source.

    oc delete catalogsource ibm-management-orchestrator -n openshift-marketplace
    

5. Remove the IBM Cloud Pak for Multicloud Management operator

  1. Click Operators > Installed Operators.
  2. Switch to the openshift-operators namespace.
  3. Locate the IBM Cloud Pak for Multicloud Management operator.
  4. Click the overflow menu icon and click Uninstall Operator.

6. Remove the components

Remove the configmap, secrets, and storage components.

Delete the configmap

Remove the configmap sre-inventory-rhacm-search-service by running the following command.

oc -n kube-system delete configmap sre-inventory-rhacm-search-service

Delete persistent volume claims

Manually delete the persistent volume claims (PVCs) that were created by the components that you installed in your cluster. To identify the PVCs to delete, see PVCs created by operators during the installation.

To delete the PVCs, complete the following steps.

  1. Click Storage > Persistent Volume Claim.
  2. Switch to the namespace from where you are deleting the PVCs.
  3. Locate the IBM Cloud Pak for Multicloud Management-related PVCs.
  4. Click the overflow menu icon and click Delete.

Delete the persistent volumes and storage classes

If you manually created storage classes, you must now delete the persistent volumes associated with the storage classes and then delete the storage classes.

To determine which persistent volumes must be deleted, run oc get pv | grep <pvc_name> where the <pvc_name> is listed in PVCs created by operators during the installation. You can delete persistent volumes from the OpenShift console or from the command line.

To delete manually created storage classes:

  1. Click Storage > Storage Classes.
  2. Locate the IBM Cloud Pak for Multicloud Management-related storage classes.
  3. Click the overflow menu icon and click Delete Storage Class.

Note If you are using local storage, you must manually delete all data from the created folders/volumes.

Note: It might also be worth checking the Additional steps to be completed for specific services or modules in case you need to complete any additional steps for a specific service or module.

7. Remove orphaned secrets and custom resources definitions (CRDs)

There might be some secrets and CRDs that the IBM Cloud Pak for Multicloud Management uninstallation did not remove. You can remove them by running the following commands.

  1. Log in to your infrastructure node with the oc login command.

  2. Download the cp4mcm-cleanup-utility.sh script. If you downloaded the script earlier during uninstallation, proceed with the next step.

    wget https://raw.githubusercontent.com/IBM/cp4mcm-samples/master/scripts/cp4mcm-cleanup-utility.sh
    
  3. Assign executable permission to the script.

    chmod +x cp4mcm-cleanup-utility.sh
    
  4. Run the script.

    ./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode postUninstallCleanup
    

8. Optional: Uninstall common services

If no other IBM Cloud Pak is installed in your cluster, then complete these steps to remove the common services:

  1. Switch to the ibm-common-services namespace by selecting ibm-common-services from the Project drop-down list.

  2. Delete the Operand Deployment Lifecycle Manager OperandConfig instances.

    1. Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandConfig.

    2. Delete all the OperandConfig instances.

  3. Delete the Operand Deployment Lifecycle Manager OperandRegistry instances.

    1. Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandRegistry.

    2. Delete all the OperandRegistry instances.

  4. Uninstall the Operand Deployment Lifecycle Manager operator.

    1. Click Operators > Installed Operators.

    2. Switch to the ibm-common-services namespace.

    3. Click the overflow menu icon and click Uninstall Operator.

  5. Uninstall the IBM Common Service Operator operator.

    1. Click Operators > Installed Operators.

    2. Switch to the namespace where your IBM Cloud Pak is deployed.

    3. Click the overflow menu icon and click Uninstall Operator.

  6. Delete the ibm-common-services namespace.

    1. Click Home > Projects.

    2. Find the ibm-common-services project.

    3. Click the overflow menu icon and click Delete Project.

  7. Remove the mutating webhook:

    oc delete mutatingwebhookconfiguration ibm-common-service-webhook-configuration
    
  8. Delete the opencloud-operators catalog source:

    oc delete catalogsource opencloud-operators -n openshift-marketplace
    
  9. After you uninstall common services, some common services components can remain in the cluster. If some are remaining, remove them by completing these steps:

    1. Log in to your infrastructure node with the oc login command.
    2. Run the force-uninstall.sh script to remove the components:
      bash <(curl -s https://raw.githubusercontent.com/IBM/ibm-common-service-operator/master/common/scripts/force-uninstall.sh)
      

9. Optional: Delete the namespaces

Note: It is optional whether you want to delete the namespaces or not. If you try to delete a namespace and the namespace deletion process continues but never finishes, then, you must check all the resources (including custom resources definitions (CRDs)) that were created in that namespace and ensure they are deleted. After you have verified that all resources are deleted, you can try to delete the namespace again.

Delete the following namespaces that your IBM Cloud Pak for Multicloud Management created during installation:

Note: Before you delete a namespace, check whether there are resources in the namespace that you do not want to delete. These resources might not be for IBM Cloud Pak for Multicloud Management. If you find such a resource, first move it out of the namespace, then delete the namespace.

10. Optional: Uninstall Ansible Tower

  1. Check all resources that are created in the ansible tower's namespace by running the following command.

     oc get all -n ansible-tower
    

    The results might resemble the following example:

     NAME                                READY   STATUS      RESTARTS   AGE
     pod/ansible-tower-864d8bdcb-tjf4t   3/3     Running     0          26h
     pod/postgresql-1-deploy             0/1     Completed   0          26h
     pod/postgresql-1-ndhmh              1/1     Running     0          26h
     pod/ruby-ex-1-build                 0/1     Error       0          27h
    
     NAME                                 DESIRED   CURRENT   READY   AGE
     replicationcontroller/postgresql-1   1         1         1       26h
    
     NAME                            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
     service/ansible-tower-web-svc   NodePort    172.30.133.134   <none>        80:32427/TCP   26h
     service/postgresql              ClusterIP   172.30.137.24    <none>        5432/TCP       26h
     service/ruby-ex                 ClusterIP   172.30.238.21    <none>        8080/TCP       27h
    
     NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
     deployment.apps/ansible-tower   1/1     1            1           26h
     deployment.apps/ruby-ex         0/1     0            0           27h
    
     NAME                                      DESIRED   CURRENT   READY   AGE
     replicaset.apps/ansible-tower-864d8bdcb   1         1         1       26h
     replicaset.apps/ruby-ex-84884dc554        1         0         0       27h
    
     NAME                                            REVISION   DESIRED   CURRENT   TRIGGERED BY
     deploymentconfig.apps.openshift.io/postgresql   1          1         1         config
    
     NAME                                     TYPE     FROM   LATEST
     buildconfig.build.openshift.io/ruby-ex   Source   Git    1
    
     NAME                                 TYPE     FROM          STATUS                        STARTED        DURATION
     build.build.openshift.io/ruby-ex-1   Source   Git@01effef   Failed (GenericBuildFailed)   27 hours ago   52s
    
     NAME                                             IMAGE REPOSITORY                                                                                  TAGS     UPDATED
     imagestream.image.openshift.io/ruby-22-centos7   default-route-openshift-image-registry.apps.coors.cp.fyre.ibm.com/ansible-tower/ruby-22-centos7   latest   27 hours ago
     imagestream.image.openshift.io/ruby-ex           default-route-openshift-image-registry.apps.coors.cp.fyre.ibm.com/ansible-tower/ruby-ex
    
     NAME                                             HOST/PORT                                                        PATH   SERVICES                PORT   TERMINATION     WILDCARD
     route.route.openshift.io/ansible-tower-web-svc   ansible-tower-web-svc-ansible-tower.apps.coors.cp.fyre.ibm.com          ansible-tower-web-svc   http   edge/Redirect   None
    
  2. Delete the resources by running the following command:

     oc delete <resource_name> -n ansible-tower
    

    Where <resource_name> is the name of resources that you get in the last step.

    Note: You need to delete the non-pod resources first, and delete the pod resources at last.

  3. Remove the PVC postgresql by running the following command:

     oc delete pvc postgresql -n ansible-tower