Uninstalling foundational services
You can uninstall services by using the Operand Deployment Lifecycle Manager.
Note: The default ibm-common-services
namespace is used in the commands in the following sections. However, if you installed IBM Cloud Pak foundational services in a custom namespace in your cluster, replace ibm-common-services
with your custom namespace in the commands.
Uninstalling all services
If you want to delete all the installed services, complete the steps in this section. Complete these steps from your OpenShift cluster console.
-
Uninstall the
IBM Cloud Pak foundational services
operator. Switch to the namespace where you deployed theIBM Cloud Pak foundational services
operator. For example, theibm-common-services
namespace. Then, click Operators > Installed Operators > the overflow menu icon > Uninstall Operator. -
Delete the operator APIs from the
ibm-common-services
namespace.-
Switch to the
ibm-common-services
namespace. -
Delete the OperandRequest instances.
-
Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandRequest.
-
Delete all the OperandRequest instances that you created. When an OperandRequest instance is deleted, the services that are requested by this OperandRequest instance are deleted unless the service is requested by other OperandRequest instances.
-
Wait for the OperandRequest instances to be deleted.
-
-
Delete the OperandConfig instances.
-
Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandConfig.
-
Delete all the OperandConfig instances.
-
-
Delete the OperandRegistry instances.
-
Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandRegistry.
-
Delete all the OperandRegistry instances.
-
-
Delete the NamespaceScope instances.
-
Click Operators > Installed Operators > IBM NamespaceScope Operator > NamespaceScope.
-
Delete all the NamespaceScope instances.
-
-
-
Uninstall the Operand Deployment Lifecycle Manager operator.
-
Switch to the
openshift-operators
namespace. -
Click Operators > Installed Operators > the overflow menu icon > Uninstall Operator.
-
-
Delete the targeted namespace by using
oc delete <cs namespace>
. -
If namespace deletion fails or hangs, patch out the remaining finalizers. This can be done in another terminal or you can cancel the delete command by using Control + C (also Control + C for MacOS). Follow the following steps:
-
Determine which resources need to be patched by running:
oc describe namespace <cs namespace>
-
Under the
Conditions
field near the bottom of the output, look for theNamespaceContentRemaining
Type.Tip: Refer to the following example:
Conditions: Type Status LastTransitionTime Reason Message ---- ------ ------------------ ------ ------- NamespaceDeletionDiscoveryFailure False Wed, 25 Jan 2023 12:10:16 -0800 ResourcesDiscovered All resources successfully discovered NamespaceDeletionGroupVersionParsingFailure False Wed, 25 Jan 2023 12:10:16 -0800 ParsedGroupVersions All legacy kube types successfully parsed NamespaceDeletionContentFailure False Wed, 25 Jan 2023 12:11:07 -0800 ContentDeleted All content successfully deleted, may be waiting on finalization NamespaceContentRemaining True Wed, 25 Jan 2023 12:10:16 -0800 SomeResourcesRemain Some resources are remaining: commonwebuis.operators.ibm.com has 1 resource instances, nginxingresses.operator.ibm.com has 1 resource instances, oidcclientwatchers.operator.ibm.com has 1 resource instances, operandbindinfos.operator.ibm.com has 2 resource instances, platformapis.operator.ibm.com has 1 resource instances NamespaceFinalizersRemaining True Wed, 25 Jan 2023 12:10:16 -0800 SomeFinalizersRemain Some content in the namespace has finalizers remaining: commonui.operators.ibm.com in 1 resource instances, commonui1.operators.ibm.com in 1 resource instances, finalizer.bindinfo.ibm.com in 2 resource instances, helm.sdk.operatorframework.io/uninstall-release in 2 resource instances, oidclientwatcher.operator.ibm.com in 1 resource instances
-
For each resource listed in
NamespaceContentRemaining
, run the following two commands:oc get <resource type> -n <cs namespace>
For example,
commonwebuis.operators.ibm.com
ornginxingresses.operator.ibm.com
. Note down the name of the resources.oc patch <resource type> <resource name> -n <cs namespace> --type="json" -p '[{"op": "remove", "path":"/metadata/finalizers"}]'
Run the preceding command for each resource that is shown in the output by the previous command
oc get <resource type> -n <cs namespace
.
-
-
Verify that the uninstallation is successful.
oc get namespace ibm-common-services
If the command returns an error message that the namespace is not found, it means that the uninstallation is complete. See the following example message:
Error from server (NotFound): namespaces "ibm-common-services" not found
Uninstalling individual services
If you want to delete one or more services, complete these steps:
-
Log in to your OpenShift cluster console.
-
Switch to the
ibm-common-services
namespace by selectingibm-common-services
from the Project drop-down list. -
Access the OperandRequest API. Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandRequest.
-
Click Edit OperandRequest. Following is a sample content:
apiVersion: operator.ibm.com/v1alpha1 kind: OperandRequest metadata: name: common-service namespace: ibm-common-services spec: requests: - operands: - name: etcd - name: jenkins registry: common-service
-
For the service that you want to uninstall in your cluster, delete it from the
operands
list. For example, if you want to uninstall thejenkins
service, the OperandRequest definition would resemble the following code:apiVersion: operator.ibm.com/v1alpha1 kind: OperandRequest metadata: name: common-service namespace: ibm-common-services spec: requests: - operands: - name: etcd registry: common-service
-
Click Save. The service is uninstalled from your cluster.