Removing a two data center deployment

Convert your 2DCDR deployment to a stand-alone deployment on Kubernetes, OpenShift, and Cloud Pak for Integration.

Ensure that you have read and understand the concepts of 2DCDR. See Two data center warm-standby deployment on Kubernetes and OpenShift and Key concepts of 2DCDR and failure scenarios.
Note: When you convert the warm-standby data center to stand-alone, all data is deleted from its management database. Data deletion is to prevent an active-active situation, where the warm-standby attempts to communicate with existing portal, gateway, and analytics subsystems that the formally active data center is also communicating with.
Note: For OpenShift users: The steps that are detailed in this topic use the Kubernetes kubectl command. On OpenShift, use the equivalent oc command in its place. If you are using a top-level CR you must edit the multiSiteHA section for the subsystem in the top-level CR, instead of directly in the subsystem CRs.
Note: 2DCDR system endpoints must be changed to standalone when converting to standalone to avoid new health check issues.

Temporary conversion to stand-alone

Some API Connect maintenance operations, such as management database restore require that 2DCDR is temporarily disabled.

To convert a 2DCDR management or portal subsystem to stand-alone, follow these steps:
  1. Take a backup of your current 2DCDR configuration, by backing up the subsystem CRs.
    1. On Kubernetes and OpenShift where individual subsystem CRs are used, take the management subsystem CR backup with:
      kubectl get mgmt -o yaml > mgmt_<dr status>_2dcdr_backup.yaml
      and take the portal CR backup with:
      kubectl get ptl -o yaml > portal_<dr status>_2dcdr_backup.yaml
      where <dr status> is the current 2DCDR status of the subsystem, either active or warm-standby.
    2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, run:
      kubectl get apiconnectcluster -o yaml > apic_<dr status>_2dcdr_backup.yaml
      where <dr status> is the current 2DCDR status of the subsystem, either active or warm-standby. The APIConnectCluster CR contains the 2DCDR settings for both management and portal subsystems.
  2. Remove the 2DCDR configuration from the management subsystem. The steps to take are different for active and warm-standby:
    1. Active management subsystem:
      1. On Kubernetes and OpenShift where individual subsystem CRs are used, run:
        kubectl patch managementcluster <mgmt cr name> --type json -p='[{"op": "remove", "path": "/spec/multiSiteHA"}]'
      2. On Cloud Pak for Integration and OpenShift where the top-level CR is used:
        kubectl patch apiconnectcluster <apic cr name> --type json -p='[{"op": "remove", "path": "/spec/management/multiSiteHA"}]'
    2. Warm-standby management subsystem:
      To convert the management subsystem from warm-standby to stand-alone, you must acknowledge acceptance of this in an annotation in the management CR. The steps to convert warm-standby management to stand-alone are:
      1. On Kubernetes and OpenShift where individual subsystem CRs are used, create a file that is called remove-2dcdr-config-from-warm-standby.yaml, and paste in the following text:
        metadata:
          annotations:
            apiconnect-operator/dr-data-deletion-confirmation: "true"
        spec:
          multiSiteHA: null
        Apply the file to your management CR with:
        kubectl patch managementcluster <mgmt cr name> --type merge --patch "$(cat remove-2dcdr-config-from-warm-standby.yaml)"
      2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, create a file that is called remove-2dcdr-config-from-warm-standby.yaml and paste in the following text:
        metadata:
          annotations:
            apiconnect-operator/dr-data-deletion-confirmation: "true"
        spec:
          management:
            multiSiteHA: null
        Apply the file to your top-level CR with:
        kubectl patch apiconnectcluster <mgmt cr name> --type merge --patch "$(cat remove-2dcdr-config-from-warm-standby.yaml)"
  3. Remove the 2DCDR configuration from the portal subsystem:
    1. On Kubernetes and OpenShift where individual subsystem CRs are used, run:
      kubectl patch portalcluster <portal CR name> --type json -p='[{"op": "remove", "path": "/spec/multiSiteHA"}]'
      Delete the spec.multiSiteHA section.
    2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, run:
      kubectl patch apiconnectcluster <apic cr name> --type json -p='[{"op": "remove", "path": "/spec/portal/multiSiteHA"}]'
  4. Complete the maintenance operation that required the temporary conversion to stand-alone, such as management database restore.
  5. Restore the 2DCDR configuration by adding back the multiSiteHA sections to your subsystem CRs. You can restore these sections by copying the multiSiteHA sections from the backup files you took in step 1, and pasting them into the corresponding CRs:
    1. On Kubernetes and OpenShift where individual subsystem CRs are used:
      1. Edit the management CR:
        kubectl edit mgmt
        and paste in the multiSiteHA section from your backup mgmt_<dr status>_2dcdr_backup.yaml.
      2. Edit the portal CR:
        kubectl edit ptl
        and paste in the multiSiteHA section from your backup portal_<dr status>_2dcdr_backup.yaml.
    2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, edit the top-level CR:
      kubectl edit apiconnectcluster
      and in the spec.management.multiSiteHA, paste in the contents from the corresponding multiSiteHA sections of your apic_<dr status>_2dcdr_backup.yaml

Permanently revert to stand-alone

If you want to revert to a single data center topology:
  1. Decide which data center you want to keep. If this data center is not the current active data center, then complete the failover operation to make it the active: Failing over to the warm-standby.
  2. Remove the 2DCDR configuration section from the management subsystem CR on the active data center.
    1. On Kubernetes and OpenShift where individual subsystem CRs are used, run:
      kubectl patch managementcluster <mgmt cr name> --type json -p='[{"op": "remove", "path": "/spec/multiSiteHA"}]'
    2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, run:
      kubectl patch apiconnectcluster <apic cr name> --type json -p='[{"op": "remove", "path": "/spec/management/multiSiteHA"}]'
  3. Remove the 2DCDR configuration from the portal subsystem:
    1. On Kubernetes and OpenShift where individual subsystem CRs are used, run:
      kubectl patch portalcluster <portal CR name> --type json -p='[{"op": "remove", "path": "/spec/multiSiteHA"}]'
      Delete the spec.multiSiteHA section.
    2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, run:
      kubectl patch apiconnectcluster <apic cr name> --type json -p='[{"op": "remove", "path": "/spec/portal/multiSiteHA"}]'
  4. The next action that you take depends on what you want to do with your warm-standby data center:
    1. If you want to permanently revert to a single data center topology, then uninstall API Connect on the warm-standby data center. See: Uninstalling API Connect.
    2. Leave your warm-standby as it is, in case you decide to revert your stand-alone data center to a 2DCDR active.
    3. Convert your warm-standby subsystems to stand-alone. This operation erases all data from the management and portal databases.
      To convert the management subsystem from warm-standby to stand-alone, you must acknowledge acceptance of this in an annotation in the management CR. The steps to convert warm-standby management to stand-alone are:
      1. On Kubernetes and OpenShift where individual subsystem CRs are used, create a file that is called remove-2dcdr-config-from-warm-standby.yaml, and paste in the following text:
        metadata:
          annotations:
            apiconnect-operator/dr-data-deletion-confirmation: "true"
        spec:
          multiSiteHA: null
        Apply the file to your management CR with:
        kubectl patch managementcluster <mgmt cr name> --type merge --patch "$(cat remove-2dcdr-config-from-warm-standby.yaml)"
      2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, create a file that is called remove-2dcdr-config-from-warm-standby.yaml and paste in the following text:
        metadata:
          annotations:
            apiconnect-operator/dr-data-deletion-confirmation: "true"
        spec:
          management:
            multiSiteHA: null
        Apply the file to your top-level CR with:
        kubectl patch apiconnectcluster <mgmt cr name> --type merge --patch "$(cat remove-2dcdr-config-from-warm-standby.yaml)"
      To convert portal from warm-standby to stand-alone, manually remove the spec.multiSiteHA section from the portal CR:
      1. On Kubernetes and OpenShift where individual subsystem CRs are used, run:
        kubectl edit ptl
        Delete the spec.multiSiteHA section.
      2. On Cloud Pak for Integration and OpenShift where the top-level CR is used, run:
        kubectl edit apiconnectcluster
        Delete the spec.portal.multiSiteHA section.