Cleaning up Cloud Pak foundational services resources

Remove IBM Cloud Pak® foundational services resources that are no longer needed after the upgrade of Cloud Pak for Integration to 16.1.0.

This task must be performed by a OpenShift cluster administrator. For more information about this role, see OpenShift roles and permissions.

Before you begin

Review Upgrading before you clean up any resources. Ensure you have completed all the upgrade tasks for Cloud Pak for Integration.

Important: Before you clean up the Cloud Pak foundational services resources, confirm that you have upgraded every namespace in the OpenShift cluster that contains Cloud Pak for Integration to 16.1.0, and you do not have any other Cloud Pak that is using Cloud Pak foundational services 3.x installed on this cluster. If these conditions are not met, you can't clean up the Cloud Pak foundational services resources.

Procedure

This procedure removes resources and operators in the ibm-common-services namespace that are no longer needed after the upgrade is complete.

Steps 1-5 apply only to installations in "A single namespace on the cluster" mode. If your installation is in "All namespaces on the cluster" mode, cleanup is done automatically by Cloud Pak foundational services. Begin with step 6.

  1. (A single namespace on the cluster mode, only) Create, and then delete, a temporary OperandRequest resource in the ibm-common-services namespace for Cloud Pak foundational services to remove the resources from the previous version.

    1. Create a YAML file called operand-request.yaml with the following configuration:

      apiVersion: operator.ibm.com/v1alpha1
      kind: OperandRequest
      metadata:
         name: cleanup
         namespace: ibm-common-services
      spec:
         requests:
            - operands:
                  - name: ibm-iam-operator
                  - name: ibm-commonui-operator
                  - name: ibm-management-ingress-operator
                  - name: ibm-zen-operator
                  - name: ibm-monitoring-grafana-operator
              registry: common-service
              registryNamespace: ibm-common-services
    2. Apply the YAML file to the OpenShift cluster:

      oc apply -f operand-request.yaml
    3. When the status of the OperandRequest changes to Running, delete the OperandRequest:

      oc delete OperandRequest cleanup -n ibm-common-services

      Deleting the OperandRequest starts the cleanup of the services and their operators.

  2. To confirm that the actions in the previous step were successful, validate that the services managed by Cloud Pak foundational services are uninstalled. If any of these services remain, you cannot proceed with the remaining steps. Run the following command and review the output:

    oc get subscriptions -n ibm-common-services

    If the output returns any of the following subscriptions, this means that the corresponding services were not cleaned up as expected. This example output is a comprehensive list, and you may not get all of these subscriptions in your response:

    % oc get subscriptions -n ibm-common-services
    NAME                                       PACKAGE                               SOURCE                CHANNEL
    ibm-cert-manager-operator                  ibm-cert-manager-operator             opencloud-operators   v3
    ibm-commonui-operator                      ibm-commonui-operator-app             opencloud-operators   v3
    ibm-iam-operator                           ibm-iam-operator                      opencloud-operators   v3
    ibm-ingress-nginx-operator                 ibm-ingress-nginx-operator-app        opencloud-operators   v3
    ibm-management-ingress-operator            ibm-management-ingress-operator-app   opencloud-operators   v3
    ibm-mongodb-operator                       ibm-mongodb-operator-app              opencloud-operators   v3
    ibm-monitoring-grafana-operator            ibm-monitoring-grafana-operator-app   opencloud-operators   v3
    ibm-platform-api-operator                  ibm-platform-api-operator-app         opencloud-operators   v3
    ibm-zen-operator                           ibm-zen-operator                      opencloud-operators   v3
    ibm-licensing-operator                     ibm-licensing-operator                opencloud-operators   v3
    Important: If any of these subscriptions are present, do not proceed to the next step. Contact support for further instructions.
  3. (A single namespace on the cluster mode, only) Delete the Operand Deployment Lifecycle Manager operator in the ibm-common-services namespace.

    1. Delete the subscription:

      oc delete subscription operand-deployment-lifecycle-manager-app -n ibm-common-services
    2. Delete the CSV.

      oc delete csv -l operators.coreos.com/ibm-odlm.ibm-common-services -n ibm-common-services
  4. (A single namespace on the cluster mode, only) Delete the IBM Cloud Pak foundational services operator in the ibm-common-services namespace.

    1. Delete the subscription:

      oc delete subscription ibm-common-service-operator -n ibm-common-services
    2. Delete the CSV.

      oc delete csv -l operators.coreos.com/ibm-common-service-operator.ibm-common-services -n ibm-common-services
  5. (A single namespace on the cluster mode, only) Delete the IBM NamespaceScope operator in the ibm-common-services namespace.

    1. Delete the subscription:

      oc delete subscription ibm-namespace-scope-operator -n ibm-common-services
    2. Delete the CSV.

      oc delete csv -l operators.coreos.com/ibm-namespace-scope-operator.ibm-common-services -n ibm-common-services
  6. Validate that the resources and operators in the ibm-common-services namespace that are no longer needed are removed:

    • If your installation is in "All namespaces on the cluster" mode, the following command should return Keycloak and database pods, only:

      oc get pods -n ibm-common-services

      For example:

      % oc get pods -n ibm-common-services
      NAME                             READY   STATUS      RESTARTS   AGE
      cs-cloudpak-realm-r7xlk          0/1     Completed   0          12d
      cs-keycloak-0                    1/1     Running     0          40h
      keycloak-edb-cluster-1           1/1     Running     0          12d
      rhbk-operator-5f6d7f59d9-4xkx9   1/1     Running     0          40h

      If the command returns resources other than Keycloak and database pods, contact Support.

    • If your installation is in "A single namespace on the cluster" mode, and you upgraded all installations of Cloud Pak for Integration on this OpenShift cluster, the following command should not return any pods:

      oc get pods -n ibm-common-services

      For example:

      % oc get pods -n ibm-common-services
      No resources found in ibm-common-services namespace.