Uninstalling foundational services

You can uninstall services by using the Operand Deployment Lifecycle Manager.

Note: The default <foundational-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 <foundational-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.

  1. Uninstall the IBM Cloud Pak foundational services operator. Switch to the namespace where you deployed the IBM Cloud Pak foundational services operator. For example, the <foundational-services> namespace. Then, click Operators > Installed Operators > the overflow menu icon > Uninstall Operator.

  2. Delete the operator APIs from the <foundational-services> namespace.

    1. Switch to the <foundational-services> namespace.

    2. Delete the OperandRequest instances.

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

      2. 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.

      3. Wait for the OperandRequest instances to be deleted.

    3. Delete the OperandConfig instances.

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

      2. Delete all the OperandConfig instances.

    4. Delete the OperandRegistry instances.

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

      2. Delete all the OperandRegistry instances.

    5. Delete the NamespaceScope instances.

      1. Click Operators > Installed Operators > IBM NamespaceScope Operator > NamespaceScope.

      2. Delete all the NamespaceScope instances.

  3. Uninstall the Operand Deployment Lifecycle Manager operator.

    1. Switch to the openshift-operators namespace.

    2. Click Operators > Installed Operators > the overflow menu icon > Uninstall Operator.

  4. Uninstall the IBM NamespaceScope operator if it exists

  5. Delete tenant namespaces

    • If namespace deletion fails or hangs, patch out the finalizers for remaining objects in the namespaces.

      • 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 the NamespaceContentRemaining Type.

         Conditions:
         Type                                         Status  LastTransitionTime               Reason                Message
         ----                                         ------  ------------------               ------                -------
         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
        
      • For each resource listed in NamespaceContentRemaining, run the following two commands:

         oc get <resource type> -n <namespace>
        

        For example, resource type commonwebuis.operators.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"}]'
        
  6. Delete additional cluster resources

    1. Delete common-service-maps ConfigMap in kube-public namespace
    2. Delete ibm-cs-ns-mapping-webhook-configuration ValidatingWebhookConfiguration
    3. Delete ibm-common-service-validating-webhook-<operator-namespace> ValidatingWebhookConfiguration
    4. Delete ibm-operandrequest-webhook-configuration-<operator-namespace> MutatingWebhookConfiguration

Uninstalling individual services

If you want to delete one or more services, complete these steps:

  1. Log in to your OpenShift cluster console.

  2. Switch to the <foundational-services> namespace by selecting <foundational-services> from the Project drop-down list.

  3. Access the OperandRequest API. Click Operators > Installed Operators > Operand Deployment Lifecycle Manager > OperandRequest.

  4. Click Edit OperandRequest. Following is a sample content:

     apiVersion: operator.ibm.com/v1alpha1
     kind: OperandRequest
     metadata:
       name: common-service
       namespace: <your-foundational-services-namespace>
     spec:
       requests:
         - operands:
             - name: etcd
             - name: jenkins
           registry: common-service
    
  5. For the service that you want to uninstall in your cluster, delete it from the operands list. For example, if you want to uninstall the jenkins service, the OperandRequest definition would resemble the following code:

     apiVersion: operator.ibm.com/v1alpha1
     kind: OperandRequest
     metadata:
       name: common-service
       namespace: <your-foundational-services-namespace>
     spec:
       requests:
         - operands:
             - name: etcd
           registry: common-service
    
  6. Click Save. The service is uninstalled from your cluster.