Uninstalling API Connect subsystems

You can individually uninstall API Connect subsystems that have been deployed on Kubernetes.

Before you begin

If you want to disable the Analytics subsystem without uninstalling it, see Disabling and re-enabling the Analytics subsystem on Kubernetes.

About this task

Procedure

  1. Uninstall the Management subsystem
    1. Save the management subsystem name:
      kubectl get mgmt -n <namespace> -o yaml

      This command returns the YAML format of the management custom resource. Make a note of the name.

    2. Delete the Management Subsystem.
      kubectl delete mgmt --all -n <namespace>
      Important:

      If your deployment uses default namespaces be cautious when using kubectl delete <entity> --all commands. There can be other pods, services, and more in the default namespace. When using the default namespace, keep in mind that using kubernetes delete <entity> --all, where <entity> can delete non-APIC entities, such as sa (Service Accounts), secrets, rolebindings, etc.

      The Management CR deletion will take some time because the apiconnect operator must delete the Postgres cluster.

    3. Manually delete secrets and PVCs:
      1. Get all of the secrets that use the management subsystem name (which you determined in Step 1.a):
        kubectl get secrets -n <namespace> | grep <management-subsystem-name>
      2. For each secret that uses the management subsystem name, run the following command to delete the secret:
        kubectl delete secrets <secret_name> -n <namespace>
      3. Get all the PVCs that use the management subsystem name:
        kubectl get pvc -n <namespace> | grep <management-subsystem-name>
      4. For each PVC that uses the management subsystem name, run the following command to delete the PVC:
        kubectl delete pvc <pvc_name> -n <namespace>
    4. If management subsystem backup and restore CRs are left stale, delete them also:
      1. Get the name of the backup CR:
        kubectl get mgmtb -n <namespace>
      2. Delete the backup CR:
        kubectl delete mgmtb <backup_cr_name> -n <namespace>
      3. Get the name of the restore CR:
        kubectl get mgmtr -n <namespace>
      4. Delete the restore CR:
        kubectl delete mgmtr <restore_cr_name> -n <namespace>
  2. Uninstall Analytics subsystem
    1. Delete the Analytics subsystem, the Analytics backup, and the Analytics restore CRs.
      kubectl delete a7s --all -n <namespace>
      kubectl delete a7b --all -n <namespace>
      kubectl delete a7r --all -n <namespace> 
    2. Manually delete the Analytics secrets:
      kubectl delete secrets <secret_name> -n <namespace>

      for each of the following secrets:

      analytics-ai-endpoint
      analytics-ca
      analytics-client
      analytics-server
    3. Manually delete Analytics Persistent Volumes (PVCs):
      kubectl delete pvc <pvc_name> -n <namespace>

      for PVCs with the following naming pattern:

      data-analytics-storage
  3. Uninstall the Developer Portal subsystem
    1. Delete the Developer Portal subsystem, and the Portal backup and restore CRs.
      kubectl delete ptl --all -n <namespace>
      kubectl delete pb --all -n <namespace>
      kubectl delete pr --all -n <namespace>
    2. Manually delete Developer Portal secrets:
      kubectl delete secrets <secret_name> -n <namespace>

      for secrets with the following naming pattern:

      portal-admin
      portal-admin-client 
      portal-ca
      portal-client
      portal-db-ca
      portal-encryption-key-...
      portal-server 
      portal-web
      
    3. Manually delete these Developer Portal PVCs:
      kubectl delete pvc <pvc_name> -n <namespace>

      for PVCs with the following naming pattern:

      admin-portal-...-www-...
      backup-portal-...-www-...
      db-portal-...-db-...
      dblogs-portal-...-db-...
      web-portal-...-www-...
      
  4. Delete the DataPower Gateway subsystem.
    kubectl delete gw --all -n <namespace>
    Note: The following entries include both Multi-Protocol Gateway Service (v5-compatible) and API Gateway settings. Names that include "gwv5" refer to the Multi-Protocol Gateway Service (v5-compatible), and names that include "gwv6" refer to the API Gateway.
    1. Delete Service Accounts.
      kubectl delete sa <service_account> -n <namespace>

      for each of the following Service Accounts:

      gwv5-datapower
      gwv6-datapower
    2. Delete Secrets.
      kubectl delete secrets <secret_name> -n <namespace>

      for secrets with the following naming pattern:

      gwv5-datapower-token-...
      gwv5-dpm-sa-token-...
      gwv5-endpoint
      gwv5-manager-endpoint
      gwv6-datapower-token-...
      gwv6-dpm-sa-token-...
      gwv6-endpoint.
      gwv6-manager-endpoint
    3. Delete PVCs.
      kubectl delete pvc <pvc_name> -n <namespace>

      for PVCs with the following naming pattern:

      gwv5...
      gwv6...