Skip to content

Commit ad66482

Browse files
authored
Merge pull request #45431 from RichardHoch/dvm
MIG-1030: Document downstream network policy configuration compatibility with DVM
2 parents d844248 + db8bbeb commit ad66482

8 files changed

+147
-24
lines changed

migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ You can migrate applications with the {mtc-short} API by using the command line
2525

2626
include::modules/migration-prerequisites.adoc[leveloffset=+2]
2727
include::modules/migration-creating-registry-route-for-dim.adoc[leveloffset=+2]
28-
include::modules/migration-configuring-proxies.adoc[leveloffset=+2]
28+
include::modules/migration-about-configuring-proxies.adoc[leveloffset=+2]
29+
include::modules/migration-configuring-proxies.adoc[leveloffset=+3]
2930
include::modules/migration-migrating-applications-api.adoc[leveloffset=+2]
3031
include::modules/migration-state-migration-cli.adoc[leveloffset=+2]
3132

migrating_from_ocp_3_to_4/installing-3-4.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ To uninstall {mtc-short}, see xref:../migrating_from_ocp_3_to_4/installing-3-4.a
2020
include::modules/migration-compatibility-guidelines.adoc[leveloffset=+1]
2121
include::modules/migration-installing-legacy-operator.adoc[leveloffset=+1]
2222
include::modules/migration-installing-mtc-on-ocp-4.adoc[leveloffset=+1]
23-
include::modules/migration-configuring-proxies.adoc[leveloffset=+1]
23+
include::modules/migration-about-configuring-proxies.adoc[leveloffset=+1]
24+
include::modules/migration-configuring-proxies.adoc[leveloffset=+2]
2425

2526
For more information, see xref:../networking/enable-cluster-wide-proxy.adoc#nw-proxy-configure-object_config-cluster-wide-proxy[Configuring the cluster-wide proxy].
2627

migrating_from_ocp_3_to_4/installing-restricted-3-4.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ To uninstall {mtc-short}, see xref:../migrating_from_ocp_3_to_4/installing-restr
2424
include::modules/migration-compatibility-guidelines.adoc[leveloffset=+1]
2525
include::modules/migration-installing-mtc-on-ocp-4.adoc[leveloffset=+1]
2626
include::modules/migration-installing-legacy-operator.adoc[leveloffset=+1]
27-
include::modules/migration-configuring-proxies.adoc[leveloffset=+1]
27+
include::modules/migration-about-configuring-proxies.adoc[leveloffset=+1]
28+
include::modules/migration-configuring-proxies.adoc[leveloffset=+2]
2829

2930
For more information, see xref:../networking/enable-cluster-wide-proxy.adoc#nw-proxy-configure-object_config-cluster-wide-proxy[Configuring the cluster-wide proxy].
3031

migration_toolkit_for_containers/advanced-migration-options-mtc.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ You can migrate applications with the {mtc-short} API by using the command line
1717

1818
include::modules/migration-prerequisites.adoc[leveloffset=+2]
1919
include::modules/migration-creating-registry-route-for-dim.adoc[leveloffset=+2]
20-
include::modules/migration-configuring-proxies.adoc[leveloffset=+2]
20+
include::modules/migration-about-configuring-proxies.adoc[leveloffset=+2]
21+
include::modules/migration-configuring-proxies.adoc[leveloffset=+3]
2122
include::modules/migration-migrating-applications-api.adoc[leveloffset=+2]
2223
include::modules/migration-state-migration-cli.adoc[leveloffset=+2]
2324

migration_toolkit_for_containers/installing-mtc-restricted.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ To uninstall {mtc-short}, see xref:../migration_toolkit_for_containers/installin
3232
include::modules/migration-compatibility-guidelines.adoc[leveloffset=+1]
3333
include::modules/migration-installing-mtc-on-ocp-4.adoc[leveloffset=+1]
3434
include::modules/migration-installing-legacy-operator.adoc[leveloffset=+1]
35-
include::modules/migration-configuring-proxies.adoc[leveloffset=+1]
35+
include::modules/migration-about-configuring-proxies.adoc[leveloffset=+1]
36+
include::modules/migration-configuring-proxies.adoc[leveloffset=+2]
3637

3738
For more information, see xref:../networking/enable-cluster-wide-proxy.adoc#nw-proxy-configure-object_config-cluster-wide-proxy[Configuring the cluster-wide proxy].
3839

migration_toolkit_for_containers/installing-mtc.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ To uninstall {mtc-short}, see xref:../migration_toolkit_for_containers/installin
2323
include::modules/migration-compatibility-guidelines.adoc[leveloffset=+1]
2424
include::modules/migration-installing-legacy-operator.adoc[leveloffset=+1]
2525
include::modules/migration-installing-mtc-on-ocp-4.adoc[leveloffset=+1]
26-
include::modules/migration-configuring-proxies.adoc[leveloffset=+1]
26+
include::modules/migration-about-configuring-proxies.adoc[leveloffset=+1]
27+
include::modules/migration-configuring-proxies.adoc[leveloffset=+2]
2728

2829
For more information, see xref:../networking/enable-cluster-wide-proxy.adoc#nw-proxy-configure-object_config-cluster-wide-proxy[Configuring the cluster-wide proxy].
2930

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * migrating_from_ocp_3_to_4/installing-3-4.adoc
4+
// * migrating_from_ocp_3_to_4/installing-restricted-3-4.adoc
5+
// * migration_toolkit_for_containers/installing-mtc.adoc
6+
// * migration_toolkit_for_containers/installing-mtc-restricted.adoc
7+
8+
:_content-type: CONCEPT
9+
[id="migration-about-configuring-proxies_{context}"]
10+
= Proxy configuration
11+
12+
For {product-title} 4.1 and earlier versions, you must configure proxies in the `MigrationController` custom resource (CR) manifest after you install the {mtc-full} Operator because these versions do not support a cluster-wide `proxy` object.
13+
14+
For {product-title} 4.2 to {product-version}, the {mtc-full} ({mtc-short}) inherits the cluster-wide proxy settings. You can change the proxy parameters if you want to override the cluster-wide proxy settings.
15+
16+
[id="direct-volume-migration_{context}"]
17+
== Direct volume migration
18+
19+
Direct Volume Migration (DVM) was introduced in MTC 1.4.2. DVM supports only one proxy. The source cluster cannot access the route of the target cluster if the target cluster is also behind a proxy.
20+
21+
If you want to perform a DVM from a source cluster behind a proxy, you must configure a TCP proxy that works at the transport layer and forwards the SSL connections transparently without decrypting and re-encrypting them with their own SSL certificates. A Stunnel proxy is an example of such a proxy.
22+
23+
[id="tcp-proxy-setup-for-dvm_{context}"]
24+
=== TCP proxy setup for DVM
25+
26+
You can set up a direct connection between the source and the target cluster through a TCP proxy and configure the `stunnel_tcp_proxy` variable in the `MigrationController` CR to use the proxy:
27+
28+
[source, yaml]
29+
----
30+
apiVersion: migration.openshift.io/v1alpha1
31+
kind: MigrationController
32+
metadata:
33+
name: migration-controller
34+
namespace: openshift-migration
35+
spec:
36+
[...]
37+
stunnel_tcp_proxy: http://username:password@ip:port
38+
----
39+
40+
Direct volume migration (DVM) supports only basic authentication for the proxy. Moreover, DVM works only from behind proxies that can tunnel a TCP connection transparently. HTTP/HTTPS proxies in man-in-the-middle mode do not work. The existing cluster-wide proxies might not support this behavior. As a result, the proxy settings for DVM are intentionally kept different from the usual proxy configuration in {mtc-short}.
41+
42+
[id="why-tcp-proxy-instead-of-an-http-https-proxy_{context}"]
43+
=== Why use a TCP proxy instead of an HTTP/HTTPS proxy?
44+
45+
You can enable DVM by running Rsync between the source and the target cluster over an OpenShift route. Traffic is encrypted using Stunnel, a TCP proxy. The Stunnel running on the source cluster initiates a TLS connection with the target Stunnel and transfers data over an encrypted channel.
46+
47+
Cluster-wide HTTP/HTTPS proxies in OpenShift are usually configured in man-in-the-middle mode where they negotiate their own TLS session with the outside servers. However, this does not work with Stunnel. Stunnel requires that its TLS session be untouched by the proxy, essentially making the proxy a transparent tunnel which simply forwards the TCP connection as-is. Therefore, you must use a TCP proxy.
48+
49+
[id="dvm-known-issues_{context}"]
50+
=== Known issue
51+
52+
.Migration fails with error `Upgrade request required`
53+
54+
The migration Controller uses the SPDY protocol to execute commands within remote pods. If the remote cluster is behind a proxy or a firewall that does not support the SPDY protocol, the migration controller fails to execute remote commands. The migration fails with the error message `Upgrade request required`.
55+
Workaround: Use a proxy that supports the SPDY protocol.
56+
57+
In addition to supporting the SPDY protocol, the proxy or firewall also must pass the `Upgrade` HTTP header to the API server. The client uses this header to open a websocket connection with the API server. If the `Upgrade` header is blocked by the proxy or firewall, the migration fails with the error message `Upgrade request required`.
58+
Workaround: Ensure that the proxy forwards the `Upgrade` header.
59+
60+
[id="tuning-network-policies-for-migrations_{context}"]
61+
== Tuning network policies for migrations
62+
63+
OpenShift supports restricting traffic to or from pods using _NetworkPolicy_ or _EgressFirewalls_ based on the network plugin used by the cluster. If any of the source namespaces involved in a migration use such mechanisms to restrict network traffic to pods, the restrictions might inadvertently stop traffic to Rsync pods during migration.
64+
65+
Rsync pods running on both the source and the target clusters must connect to each other over an OpenShift Route. Existing _NetworkPolicy_ or _EgressNetworkPolicy_ objects can be configured to automatically exempt Rsync pods from these traffic restrictions.
66+
67+
[id="dvm-network-policy-configuration_{context}"]
68+
=== NetworkPolicy configuration
69+
70+
[id="egress-traffic-from-rsync-pods_{context}"]
71+
==== Egress traffic from Rsync pods
72+
73+
You can use the unique labels of Rsync pods to allow egress traffic to pass from them if the `NetworkPolicy` configuration in the source or destination namespaces blocks this type of traffic. The following policy allows *all* egress traffic from Rsync pods in the namespace:
74+
75+
[source, yaml]
76+
----
77+
apiVersion: networking.k8s.io/v1
78+
kind: NetworkPolicy
79+
metadata:
80+
name: allow-all-egress-from-rsync-pods
81+
spec:
82+
podSelector:
83+
matchLabels:
84+
owner: directvolumemigration
85+
app: directvolumemigration-rsync-transfer
86+
egress:
87+
- {}
88+
policyTypes:
89+
- Egress
90+
----
91+
92+
[id="ingress-traffic-to-rsync-pods_{context}"]
93+
==== Ingress traffic to Rsync pods
94+
95+
[source, yaml]
96+
----
97+
apiVersion: networking.k8s.io/v1
98+
kind: NetworkPolicy
99+
metadata:
100+
name: allow-all-egress-from-rsync-pods
101+
spec:
102+
podSelector:
103+
matchLabels:
104+
owner: directvolumemigration
105+
app: directvolumemigration-rsync-transfer
106+
ingress:
107+
- {}
108+
policyTypes:
109+
- Ingress
110+
----
111+
112+
[id="egressnetworkpolicy-config_{context}"]
113+
=== EgressNetworkPolicy configuration
114+
115+
The `EgressNetworkPolicy` object or _Egress Firewalls_ are OpenShift constructs designed to block egress traffic leaving the cluster.
116+
117+
Unlike the `NetworkPolicy` object, the Egress Firewall works at a project level because it applies to all pods in the namespace. Therefore, the unique labels of Rsync pods do not exempt only Rsync pods from the restrictions. However, you can add the CIDR ranges of the source or target cluster to the _Allow_ rule of the policy so that a direct connection can be setup between two clusters.
118+
119+
Based on which cluster the Egress Firewall is present in, you can add the CIDR range of the other cluster to allow egress traffic between the two:
120+
121+
[source, yaml]
122+
----
123+
apiVersion: network.openshift.io/v1
124+
kind: EgressNetworkPolicy
125+
metadata:
126+
name: test-egress-policy
127+
namespace: <namespace>
128+
spec:
129+
egress:
130+
- to:
131+
cidrSelector: <cidr_of_source_or_target_cluster>
132+
type: Deny
133+
----

modules/migration-configuring-proxies.adoc

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@
99
[id="migration-configuring-proxies_{context}"]
1010
= Configuring proxies
1111

12-
For {product-title} 4.1 and earlier versions, you must configure proxies in the `MigrationController` custom resource (CR) manifest after you install the {mtc-full} Operator because these versions do not support a cluster-wide `proxy` object.
13-
14-
For {product-title} 4.2 to {product-version}, the {mtc-full} ({mtc-short}) inherits the cluster-wide proxy settings. You can change the proxy parameters if you want to override the cluster-wide proxy settings.
15-
16-
You must configure the proxies to allow the `HTTP/2` protocol and to forward the `Upgrade HTTP` header to the API server. Otherwise, an `Upgrade request required` error is displayed. The `MigrationController` CR uses `HTTP/2` to run commands within remote pods. The `Upgrade HTTP` header is required in order to open a websocket connection with the API server.
17-
18-
.Direct volume migration
19-
20-
If you are performing a direct volume migration (DVM) from a source cluster behind a proxy, you must configure an Stunnel proxy. Stunnel creates a transparent tunnel between the source and target clusters for the TCP connection without changing the certificates.
21-
22-
DVM supports only one proxy. The source cluster cannot access the route of the target cluster if the target cluster is also behind a proxy.
23-
2412
.Prerequisites
2513

2614
* You must be logged in as a user with `cluster-admin` privileges on all clusters.
@@ -46,14 +34,10 @@ metadata:
4634
...
4735
spec:
4836
stunnel_tcp_proxy: http://<username>:<password>@<ip>:<port> <1>
49-
httpProxy: http://<username>:<password>@<ip>:<port> <2>
50-
httpsProxy: http://<username>:<password>@<ip>:<port> <3>
51-
noProxy: example.com <4>
37+
noProxy: example.com <2>
5238
----
5339
<1> Stunnel proxy URL for direct volume migration.
54-
<2> Proxy URL for creating HTTP connections outside the cluster. The URL scheme must be `http`.
55-
<3> Proxy URL for creating HTTPS connections outside the cluster. If this is not specified, then `httpProxy` is used for both HTTP and HTTPS connections.
56-
<4> Comma-separated list of destination domain names, domains, IP addresses, or other network CIDRs to exclude proxying.
40+
<2> Comma-separated list of destination domain names, domains, IP addresses, or other network CIDRs to exclude proxying.
5741
+
5842
Preface a domain with `.` to match subdomains only. For example, `.y.com` matches `x.y.com`, but not `y.com`. Use `*` to bypass proxy for all destinations.
5943
If you scale up workers that are not included in the network defined by the `networking.machineNetwork[].cidr` field from the installation configuration, you must add them to this list to prevent connection issues.

0 commit comments

Comments
 (0)