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.
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.
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 .
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.
Log in to your infrastructure node with the oc login command.
Download the script.
wget https://raw.githubusercontent.com/IBM/cp4mcm-samples/master/scripts/cp4mcm-cleanup-utility.sh
Assign executable permission to the script.
chmod +x cp4mcm-cleanup-utility.sh
Run the following commands from the directory where you downloaded the script.
To remove the components of all the operands that are listed in this section, run the following command:
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode preUninstallCleanup
To remove the components of a particular operand, run the following command. Replace <full-path-to-your-kubeconfig-file> with the path to the directory containing the kubeconfig file. Check for the file in the ~/.kube/config directory. If it is not in this directory, contact your cluster administrator or the person who set up the OpenShift Container Platform about the location of this file. For more information about the kubeconfig file, refer to
Organizing Cluster Access Using kubeconfig Files.
To remove the ibm-management-sre-chatops operand, run this command:
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode customResourceCleanup --Chatops
To remove the ibm-management-vmpolicy-ansible operand, run this command:
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode customResourceCleanup --VMPolicyAnsible
To remove the ibm-management-im-install operand, run this command:
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode customResourceCleanup --IMInstall
To remove the ibm-management-infra-grc operand, run this command:
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode customResourceCleanup --InfraGRC
To remove the ibm-management-infra-vm operand, run this command:
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode customResourceCleanup --InfraVM
Installation in the Filter by kind text box.cp4mcm namespace, select cp4mcm from the Project drop-down list. Wait until the installation objects are deleted and the installation instance is removed. This process might take up to 10 minutes.
Log in to your infrastructure node with the oc login command.
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>
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.
management-infrastructure-management namespace:oc get all -n management-infrastructure-management
management-monitoring namespace:oc get all -n management-monitoring
management-operations namespace:oc get all -n management-operations
management-security-services namespace:oc get all -n management-security-services
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>
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
openshift-operators namespace.Remove the configmap, secrets, and storage components.
Remove the configmap sre-inventory-rhacm-search-service by running the following command.
oc -n kube-system delete configmap sre-inventory-rhacm-search-service
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.
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 persistent volumes from the OpenShift Container Platform console:
To delete manually created persistent volumes from the command line, run:
oc delete pv <pv_name> --force
To delete manually created storage classes:
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.
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.
Log in to your infrastructure node with the oc login command.
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
Assign executable permission to the script.
chmod +x cp4mcm-cleanup-utility.sh
Run the script.
./cp4mcm-cleanup-utility.sh --kubeconfigpath <full-path-to-your-kubeconfig-file> --mode postUninstallCleanup
If no other IBM Cloud Pak is installed in your cluster, then complete these steps to remove the common services:
Switch to the ibm-common-services namespace by selecting ibm-common-services from the Project drop-down list.
Delete the Operand Deployment Lifecycle Manager OperandConfig instances.
Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandConfig.
Delete all the OperandConfig instances.
Delete the Operand Deployment Lifecycle Manager OperandRegistry instances.
Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandRegistry.
Delete all the OperandRegistry instances.
Uninstall the Operand Deployment Lifecycle Manager operator.
Click Operators > Installed Operators.
Switch to the ibm-common-services namespace.
Click the overflow menu icon and click Uninstall Operator.
Uninstall the IBM Common Service Operator operator.
Click Operators > Installed Operators.
Switch to the namespace where your IBM Cloud Pak is deployed.
Click the overflow menu icon and click Uninstall Operator.
Delete the ibm-common-services namespace.
Click Home > Projects.
Find the ibm-common-services project.
Click the overflow menu icon and click Delete Project.
Remove the mutating webhook:
oc delete mutatingwebhookconfiguration ibm-common-service-webhook-configuration
Delete the opencloud-operators catalog source:
oc delete catalogsource opencloud-operators -n openshift-marketplace
After you uninstall common services, some common services components can remain in the cluster. If some are remaining, remove them by completing these steps:
oc login command.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)
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:
cp4mcm. 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.
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
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.
Remove the PVC postgresql by running the following command:
oc delete pvc postgresql -n ansible-tower