This is a cache of https://docs.openshift.com/container-platform/4.8/migration_toolkit_for_containers/network-considerations-mtc.html. It is a snapshot of the page at 2024-11-18T20:13:33.309+0000.
Network considerations | Migration Toolkit for Containers | OpenShift Container Platform 4.8
×

dns considerations

The dns domain of the target cluster is different from the domain of the source cluster. By default, applications get FQdns of the target cluster after migration.

To preserve the source dns domain of migrated applications, select one of the two options described below.

Isolating the dns domain of the target cluster from the clients

You can allow the clients' requests sent to the dns domain of the source cluster to reach the dns domain of the target cluster without exposing the target cluster to the clients.

Procedure
  1. Place an exterior network component, such as an application load balancer or a reverse proxy, between the clients and the target cluster.

  2. Update the application FQDN on the source cluster in the dns server to return the IP address of the exterior network component.

  3. Configure the network component to send requests received for the application in the source domain to the load balancer in the target cluster domain.

  4. Create a wildcard dns record for the *.apps.source.example.com domain that points to the IP address of the load balancer of the source cluster.

  5. Create a dns record for each application that points to the IP address of the exterior network component in front of the target cluster. A specific dns record has higher priority than a wildcard record, so no conflict arises when the application FQDN is resolved.

  • The exterior network component must terminate all secure TLS connections. If the connections pass through to the target cluster load balancer, the FQDN of the target application is exposed to the client and certificate errors occur.

  • The applications must not return links referencing the target cluster domain to the clients. Otherwise, parts of the application might not load or work properly.

Setting up the target cluster to accept the source dns domain

You can set up the target cluster to accept requests for a migrated application in the dns domain of the source cluster.

Procedure

For both non-secure HTTP access and secure HTTPS access, perform the following steps:

  1. Create a route in the target cluster’s project that is configured to accept requests addressed to the application’s FQDN in the source cluster:

    $ oc expose svc <app1-svc> --hostname <app1.apps.source.example.com> \
     -n <app1-namespace>

    With this new route in place, the server accepts any request for that FQDN and sends it to the corresponding application pods. In addition, when you migrate the application, another route is created in the target cluster domain. Requests reach the migrated application using either of these hostnames.

  2. Create a dns record with your dns provider that points the application’s FQDN in the source cluster to the IP address of the default load balancer of the target cluster. This will redirect traffic away from your source cluster to your target cluster.

    The FQDN of the application resolves to the load balancer of the target cluster. The default ingress controller router accept requests for that FQDN because a route for that hostname is exposed.

For secure HTTPS access, perform the following additional step:

  1. Replace the x509 certificate of the default ingress controller created during the installation process with a custom certificate.

  2. Configure this certificate to include the wildcard dns domains for both the source and target clusters in the subjectAltName field.

    The new certificate is valid for securing connections made using either dns domain.

Additional resources

Network traffic redirection strategies

After a successful migration, you must redirect network traffic of your stateless applications from the source cluster to the target cluster.

The strategies for redirecting network traffic are based on the following assumptions:

  • The application pods are running on both the source and target clusters.

  • Each application has a route that contains the source cluster hostname.

  • The route with the source cluster hostname contains a CA certificate.

  • For HTTPS, the target router CA certificate contains a Subject Alternative Name for the wildcard dns record of the source cluster.

Consider the following strategies and select the one that meets your objectives.

  • Redirecting all network traffic for all applications at the same time

    Change the wildcard dns record of the source cluster to point to the target cluster router’s virtual IP address (VIP).

    This strategy is suitable for simple applications or small migrations.

  • Redirecting network traffic for individual applications

    Create a dns record for each application with the source cluster hostname pointing to the target cluster router’s VIP. This dns record takes precedence over the source cluster wildcard dns record.

  • Redirecting network traffic gradually for individual applications

    1. Create a proxy that can direct traffic to both the source cluster router’s VIP and the target cluster router’s VIP, for each application.

    2. Create a dns record for each application with the source cluster hostname pointing to the proxy.

    3. Configure the proxy entry for the application to route a percentage of the traffic to the target cluster router’s VIP and the rest of the traffic to the source cluster router’s VIP.

    4. Gradually increase the percentage of traffic that you route to the target cluster router’s VIP until all the network traffic is redirected.

  • User-based redirection of traffic for individual applications

    Using this strategy, you can filter TCP/IP headers of user requests to redirect network traffic for predefined groups of users. This allows you to test the redirection process on specific populations of users before redirecting the entire network traffic.

    1. Create a proxy that can direct traffic to both the source cluster router’s VIP and the target cluster router’s VIP, for each application.

    2. Create a dns record for each application with the source cluster hostname pointing to the proxy.

    3. Configure the proxy entry for the application to route traffic matching a given header pattern, such as test customers, to the target cluster router’s VIP and the rest of the traffic to the source cluster router’s VIP.

    4. Redirect traffic to the target cluster router’s VIP in stages until all the traffic is on the target cluster router’s VIP.