Uninstalling capabilities from the command line
Delete the namespace that you used to install to completely remove the deployed patterns.
About this task
Uninstalling and cleaning up the cluster involves several separate high-level tasks.
- Uninstalling the CP4BA 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 CP4BA deployment.
If you do delete all the secrets that you created for Cloud Pak for Business Automation, then you must create them again if you want to install another CP4BA deployment.
- Deleting the CP4BA project.
- Uninstalling the Cloud Pak foundational services is necessary only if you want to completely clean up the cluster. The uninstallation of CP4BA 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 CP4BA deployment, use the following steps.
Procedure
What to do next
If you now plan to install another instance of the Cloud Pak on the same cluster, check if the
dependencies like Namespaces
and OperandRequests
are properly
deleted. If you are sharing the project with another Cloud Pak, then do not delete the
dependencies.
- Deleting PVCs
-
If you uninstalled all the operators, then you can delete the PVCs from the project. Click Delete PersistentVolumeClaim. If you deleted only CP4BA and its related operators, then you can click , change the "Filter" to Label and enter "release=24.0.0" in the Search by label field. You can then delete the listed PVCs by clicking .
for each PVC, and then click - Optional: Deleting PVs
-
To identify which PV can be removed, check the status of the PV. If the status is “
Available
”, then the PVs can be deleted.- Get a list of all the PVs.
oc get pv
- Delete a PV.
oc delete pv <PV name>
For more information about cleaning up your data, see Cleaning up data.
- Get a list of all the PVs.
- Deleting secrets
- Remove the foundation subscription in the CP4BA namespace by clicking
Subscription for
operators.coreos.com/v1alpha1
in the Resource list, and then selecting Remove Subscription from theicp4a-foundation-operator
menu. Now all of the CP4BA secrets can be deleted.
, selecting
- Uninstall foundational services
-
Note: If you plan to clean up your Cloud Pak for Business Automation 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 inkube-public
namespace. The Cloud Pak foundational services and thecommon-service-maps
ConfigMap inkube-public
namespace are required when you run thecp4a-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 Cloud Pak for Business Automation and Cloud Pak foundational services namespaces
- You can use the
cp4a-clean-up.sh
script to clean up resources that are left over after uninstallation. The script makes sure that all resources from the Cloud Pak for Business Automation and Cloud Pak foundational services namespaces are cleaned up. If a namespace is not cleaned up, you may not be able to terminate the namespace or some resources may show up when you use the same namespace name. If your Cloud Pak foundational services is not shared with other Cloud Paks, then you can clean up your Cloud Pak for Business Automation and Cloud Pak foundational services namespaces.Note: Run the script if any of the following checks are true:- The CP4BA namespace is not deleted.
- The
common-service-maps
ConfigMap inkube-public
namespace is not deleted.
- Change the directory to the scripts folder
under cert-kubernetes/scripts.
cd /<path_to_cert-kubernetes>/cert-kubernetes/scripts
Where <path_to_cert-kubernetes> is the path to
cert-kubernetes
. - Run the cp4a-clean-up.sh script to clean up the Cloud Pak for Business Automation and Cloud Pak foundational services
namespaces.
./cp4a-clean-up.sh -n <cp4ba-ns>
Where <cp4ba-ns> is the target namespace.
Important: If you installed your CP4BA deployment with separation of duties, make sure that you use the namespace that contains the CP4BA deployment and not the CP4BA operators namespace. If you do not specify a namespace, the script asks you to enter the services namespace.
The script takes the following actions:- Checks whether the Cloud Pak foundational services associated with Cloud Pak for Business Automation is shared and if the script detects that Cloud Pak foundational services is shared, the script cleans only the Cloud Pak for Business Automation namespace.
- The script detects if the deployment has separation of duty where the Cloud Pak for Business Automation operators and Cloud Pak for Business Automation deployment are in different namespaces. If the Cloud Pak for Business Automation operators and Cloud Pak for Business Automation deployment are in different namespaces, the script cleans both the Cloud Pak for Business Automation and Cloud Pak foundational services namespaces.
- The script asks whether there are multiple Cloud Pak for Business Automation deployments on the same cluster. If you select Yes, then the Cloud Pak for Business Automation related custom resource definitions are not deleted. If you select No, then the Cloud Pak for Business Automation related custom resource definitions are deleted.
- The script displays the list of resources in each namespace to be deleted. You need to confirm whether to clean up the Cloud Pak for Business Automation and Cloud Pak foundational services namespaces including deleting the namespace where the Cloud Pak for Business Automation instance is installed.
- Deleting the CP4BA 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.
- Deleting the catalog sources
- If you decide to remove CP4BA completely, then remove the related catalog sources.
- Click Configuration tab, scroll down the list, and then click OperatorHub. , click the
- Select the Sources tab.
- Delete the following sources:
ibm-cp4a-operator-catalog
ibm-opencontent-flink
ibm-cs-opensearch-catalog
ibm-cert-manager-catalog
ibm-cs-install-catalog
bts-operator
ibm-iam-operator-catalog
ibm-zen-operator-catalog
ibm-events-operator-catalog
cloud-native-postgresql-catalog
ibm-fncm-operator-catalog
-
Set the
NAMESPACE
environment variable to the namespace CP4BA is deployed in.export NAMESPACE="cp4ba-project"
Note: If the operators are installed in the "All namespaces on the cluster" mode, they are in theopenshift-operators
namespace. -
Delete the
Subscription
andClusterServiceVersion
for each catalog from your namespace.RESOURCE_TYPES=" ibm-cp4a-operator-catalog ibm-opencontent-flink ibm-cs-opensearch-catalog ibm-cert-manager-catalog ibm-cs-install-catalog-v4-6-4 bts-operator ibm-iam-operator-catalog ibm-zen-operator-catalog ibm-events-operator-catalog cloud-native-postgresql-catalog ibm-fncm-operator-catalog" for resource_type in ${RESOURCE_TYPES}; do echo "Deleting resource type: $resource_type" oc delete subscription ${resource_type} -n $NAMESPACE --all oc delete csv ${resource_type} -n $NAMESPACE --all done
- Optional: Deleting custom resource definitions
-
If you plan to remove all of the Cloud Pak dependencies, the custom resource definitions (CRD) for both Cloud Pak for Business Automation and the Cloud Pak foundational services can be deleted.Note: Do not delete the custom resource definitions if you have other Cloud Pak for Business Automation deployment on the cluster.
Click Delete CustomResourceDefinition.
, search by the name and clickDelete the following CRDs from the cluster.contentrequests.icp4a.ibm.com contents.icp4a.ibm.com foundationrequests.icp4a.ibm.com foundations.icp4a.ibm.com icp4aclusters.icp4a.ibm.com processfederationservers.icp4a.ibm.com wfpsruntimes.icp4a.ibm.com
You also need to uninstall the following custom resource definitions:FederatedSystem ICP4AAutomationDecisionService ICP4ADocumentProcessingEngine ICP4AOperationalDecisionManager InsightsEngine