Removing API Connect on OpenShift or Cloud Pak for Integration

Remove your entire API Connect deployment on OpenShift or Cloud Pak for Integration.

About this task

These instructions completely remove API Connect, including PVCs and secrets.

Attention: Run the commands in the sequence shown on this page. If you run commands out of sequence, you might encounter a problem where the deletion of namespaces hangs.

Procedure

  1. If Event Endpoint Management is installed, run the following command to determine the name of your Event Endpoint Management instance:
    oc get eem -n <APIC-namespace>
  2. If you are using a top-level CR, run the following command to determine the name of your API Connect instance:
    oc get apiconnectcluster -n <APIC-namespace>
  3. If you are using a top-level CR, run the following command to delete the API Connect operands (subsystems):
    oc delete apiconnectcluster <name_of_apic_instance> -n <APIC-namespace>
  4. Run the following command to delete the API Connect backup and restore CRs:
    oc delete apic --all -n <APIC-namespace>
  5. Run the following command to delete the secrets that are associated with your deleted API Connect cluster:
    oc get secrets --no-headers -n <APIC-namespace> | cut -d' ' -f1 | grep "^<first_10_characters_of_apic_instance_name>-" | xargs oc delete secret -n <APIC-namespace>

    Where <first_10_characters_of_apic_instance_name> refers to the name of your API Connect instance.

    Note: This step assumes that any secrets that you want to keep in your namespace do not have a name that starts with the same 10 first characters of the API Connect Cluster name.
  6. If Event Endpoint Management is installed, run the following command to delete the secrets that are associated with your deleted Event Endpoint Management instance:
    oc get secrets --no-headers -n <APIC-namespace> | cut -d' ' -f1 | grep "^<first_10_characters_of_eem_instance_name>-" | xargs oc delete secret -n <APIC-namespace>

    Where <first_10_characters_of_eem_instance_name> refers to the name of your Event Endpoint Manager instance.

    Note: This step assumes that any secrets that you want to keep in your namespace do not have a name that starts with the same 10 first characters of the Event Endpoint Manager name.
  7. If the only software that is deployed in your namespace is API Connect, run the following command to delete the PVCs associated with your deleted API Connect cluster:
    oc delete pvc -n <APIC-namespace> -l app.kubernetes.io/managed-by=ibm-apiconnect
  8. If you have no other software in your namespace that uses a CrunchyData Postgres cluster, delete the CrunchyData Postgres cluster:
    oc delete pvc -n <APIC-namespace> -l vendor=crunchydata
  9. Check for and remove any other Crunchy data: Removing postgres resources on OpenShift and Cloud Pak for Integration.
  10. Run the following commands to delete the API Connect secret rotation CRs for the cluster:
    oc delete mgmtsr -n <APIC-namespace>  --all
    oc delete ptlsr -n <APIC-namespace> --all
  11. Optional: If you created a namespace specifically for API Connect, and are not using it for anything else, you can delete the namespace. If your API Connect operators are installed in this namespace, instead of in a shared global namespace, they are also deleted.
    oc delete ns <APIC-namespace>
    Deleting the namespace removes any remaining certificates and secrets.
    Note: Namespace deletion can get stuck, check that the namespace is deleted with:
    oc get ns <APIC-namespace>

    If the namespace is still present, to see why deletion is stuck, run:

    oc describe ns <APIC-namespace>
  12. Optional: Delete the API Connect operator deployments.
    If your API Connect operator deployments are in a global namespace they are not deleted when your API Connect namespace is deleted. To delete the API Connect operators:
    1. Open the OpenShift web console and go to Installed Operators, in the namespace where the API Connect operators are installed.
    2. For each operator, click the options menu, and select Uninstall Operator.
    API Connect operator might have created a number of operand requests with IBM Cloud Pak foundational services (previously called Common Services) to deploy services such as Cert-Manager. In addition, API Connect requires the use of a DataPower Gateway, so the DataPower operator might be installed in the API Connect namespace. If those artifacts are no longer needed, uninstall them individually.
    Note: DataPower can be deployed on its own without API Connect. It is possible that the DataPower operator was installed for another purpose and not for use with API Connect, so check with your organization before you delete it.

    Deleting the operators from the web console ensures that related subscriptions, CSVs, and install plans are also removed.