Skip to content

Commit 2b29ae9

Browse files
authored
Merge pull request #31142 from jboxman/OSDOCS-1860
OSDOCS#1860 - OpenShift SDN egress IPs are balanced equally
2 parents a262322 + 84ea9cc commit 2b29ae9

File tree

3 files changed

+53
-36
lines changed

3 files changed

+53
-36
lines changed

modules/nw-egress-ips-about.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,27 @@ When using the automatic assignment approach for egress IP addresses the followi
193193

194194
- You set the `egressCIDRs` parameter of each node's `HostSubnet` resource to indicate the range of egress IP addresses that can be hosted by a node.
195195
{product-title} sets the `egressIPs` parameter of the `HostSubnet` resource based on the IP address range you specify.
196+
ifeval::[{product-version} < 4.8]
196197
- Only a single egress IP address per namespace is supported when using the automatic assignment mode.
198+
endif::[]
197199

198200
If the node hosting the namespace's egress IP address is unreachable, {product-title} will reassign the egress IP address to another node with a compatible egress IP address range.
199201
The automatic assignment approach works best for clusters installed in environments with flexibility in associating additional IP addresses with nodes.
200202

201203
[id="considerations-manual-egress-ips"]
202204
== Considerations when using manually assigned egress IP addresses
203205

206+
This approach is recommended for clusters installed in public cloud environments, where there can be limitations on associating additional IP addresses with nodes.
207+
204208
When using the manual assignment approach for egress IP addresses the following considerations apply:
205209

206210
- You set the `egressIPs` parameter of each node's `HostSubnet` resource to indicate the IP addresses that can be hosted by a node.
207211
- Multiple egress IP addresses per namespace are supported.
208212

209-
When a namespace has multiple egress IP addresses, if the node hosting the first egress IP address is unreachable, {product-title} will automatically switch to using the next available egress IP address until the first egress IP address is reachable again.
213+
If a namespace has multiple egress IP addresses and those addresses are hosted on multiple nodes, the following additional considerations apply:
210214

211-
This approach is recommended for clusters installed in public cloud environments, where there can be limitations on associating additional IP addresses with nodes.
215+
- If a pod is on a node that is hosting an egress IP address, that pod always uses the egress IP address on the node.
216+
- If a pod is not on a node that is hosting an egress IP address, that pod uses an egress IP address at random.
212217
endif::openshift-sdn[]
213218

214219
ifdef::openshift-sdn[]

modules/nw-egress-ips-automatic.adoc

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * networking/assigning-egress-ips.adoc
3+
// * networking/openshift_sdn/assigning-egress-ips.adoc
44

55
[id="nw-egress-ips-automatic_{context}"]
66
= Configuring automatically assigned egress IP addresses for a namespace
@@ -20,16 +20,20 @@ following JSON:
2020
+
2121
[source,terminal]
2222
----
23-
$ oc patch netnamespace <project_name> --type=merge -p \ <1>
23+
$ oc patch netnamespace <project_name> --type=merge -p \
2424
'{
2525
"egressIPs": [
26-
"<ip_address>" <2>
26+
"<ip_address>"
2727
]
2828
}'
2929
----
30-
<1> Specify the name of the project.
31-
<2> Specify a single egress IP address. Using multiple IP addresses is not
32-
supported.
30+
+
31+
--
32+
where:
33+
34+
`<project_name>`:: Specifies the name of the project.
35+
`<ip_address>`:: Specifies one or more egress IP addresses for the `egressIPs` array.
36+
--
3337
+
3438
For example, to assign `project1` to an IP address of 192.168.1.100 and
3539
`project2` to an IP address of 192.168.1.101:
@@ -47,15 +51,20 @@ parameter for each host using the following JSON:
4751
+
4852
[source,terminal]
4953
----
50-
$ oc patch hostsubnet <node_name> --type=merge -p \ <1>
54+
$ oc patch hostsubnet <node_name> --type=merge -p \
5155
'{
5256
"egressCIDRs": [
53-
"<ip_address_range_1>", "<ip_address_range_2>" <2>
57+
"<ip_address_range>", "<ip_address_range>"
5458
]
5559
}'
5660
----
57-
<1> Specify a node name.
58-
<2> Specify one or more IP address ranges in CIDR format.
61+
+
62+
--
63+
where:
64+
65+
`<node_name>`:: Specifies a node name.
66+
`<ip_address_range>`:: Specifies an IP address range in CIDR format. You can specify more than one address range for the `egressCIDRs` array.
67+
--
5968
+
6069
For example, to set `node1` and `node2` to host egress IP addresses
6170
in the range 192.168.1.0 to 192.168.1.255:

modules/nw-egress-ips-static.adoc

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * networking/assigning-egress-ips.adoc
3+
// * networking/openshift_sdn/assigning-egress-ips.adoc
44

55
[id="nw-egress-ips-static_{context}"]
66
= Configuring manually assigned egress IP addresses for a namespace
@@ -19,47 +19,52 @@ object with the desired IP addresses:
1919
+
2020
[source,terminal]
2121
----
22-
$ oc patch netnamespace <project> --type=merge -p \ <1>
22+
$ oc patch netnamespace <project_name> --type=merge -p \
2323
'{
24-
"egressIPs": [ <2>
24+
"egressIPs": [
2525
"<ip_address>"
26-
]
26+
]
2727
}'
2828
----
29-
<1> Specify the name of the project.
30-
<2> Specify one or more egress IP addresses. The `egressIPs` parameter is an
31-
array.
3229
+
33-
For example, to assign the `project1` project to an IP address of
34-
`192.168.1.100`:
30+
--
31+
where:
32+
33+
`<project_name>`:: Specifies the name of the project.
34+
`<ip_address>`:: Specifies one or more egress IP addresses for the `egressIPs` array.
35+
--
36+
+
37+
For example, to assign the `project1` project to the IP addresses `192.168.1.100` and `192.168.1.101`:
3538
+
3639
[source,terminal]
3740
----
3841
$ oc patch netnamespace project1 --type=merge \
39-
-p '{"egressIPs": ["192.168.1.100"]}'
42+
-p '{"egressIPs": ["192.168.1.100","192.168.1.101"]}'
4043
----
4144
+
42-
You can set `egressIPs` to two or more IP addresses on different nodes to
43-
provide high availability. If multiple egress IP addresses are set, pods use the
44-
first IP in the list for egress, but if the node hosting that IP address fails,
45-
pods switch to using the next IP in the list after a short delay.
45+
To provide high availability, set the `egressIPs` value to two or more IP addresses on different nodes. If multiple egress IP addresses are set, then pods use all egress IP addresses roughly equally.
4646

4747
. Manually assign the egress IP to the node hosts. Set the `egressIPs` parameter
4848
on the `HostSubnet` object on the node host. Using the following JSON, include
49-
as many IPs as you want to assign to that node host:
49+
as many IP addresses as you want to assign to that node host:
5050
+
5151
[source,terminal]
5252
----
53-
$ oc patch hostsubnet <node_name> --type=merge -p \ <1>
53+
$ oc patch hostsubnet <node_name> --type=merge -p \
5454
'{
55-
"egressIPs": [ <2>
56-
"<ip_address_1>",
57-
"<ip_address_N>"
55+
"egressIPs": [
56+
"<ip_address>",
57+
"<ip_address>"
5858
]
5959
}'
6060
----
61-
<1> Specify the name of the node.
62-
<2> Specify one or more egress IP addresses. The `egressIPs` field is an array.
61+
+
62+
--
63+
where:
64+
65+
`<node_name>`:: Specifies a node name.
66+
`<ip_address>`:: Specifies an IP address. You can specify more than one IP address for the `egressIPs` array.
67+
--
6368
+
6469
For example, to specify that `node1` should have the egress IPs `192.168.1.100`,
6570
`192.168.1.101`, and `192.168.1.102`:
@@ -70,6 +75,4 @@ $ oc patch hostsubnet node1 --type=merge -p \
7075
'{"egressIPs": ["192.168.1.100", "192.168.1.101", "192.168.1.102"]}'
7176
----
7277
+
73-
In the previous example, all egress traffic for `project1` will be routed to the
74-
node hosting the specified egress IP, and then connected (using NAT) to that IP
75-
address.
78+
In the previous example, all egress traffic for `project1` will be routed to the node hosting the specified egress IP, and then connected through Network Address Translation (NAT) to that IP address.

0 commit comments

Comments
 (0)