Skip to content

Commit 4f0cc9c

Browse files
committed
OSDOCS-10661:updates for local gateway mode
1 parent 8882c02 commit 4f0cc9c

File tree

3 files changed

+105
-1
lines changed

3 files changed

+105
-1
lines changed

modules/nw-operator-cr.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ endif::operator[]
206206

207207
|`gatewayConfig`
208208
|`object`
209-
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway.
209+
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Accepted values are `Shared` and `Local`. The default value is `Shared`. In the default setting, all external traffic leaving the cluster is routed through a centralized gateway node and pods use a single egress IP for outbound traffic. In the `Local` setting, external traffic from pods exits through the node that it is running on. Each node serves as its own gateway.
210210

211211
[NOTE]
212212
====

modules/nwt-gateway-mode.adoc

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Module included in the following assemblies:
2+
//
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="nwt-gateway-mode_{context}"]
6+
= Setting local and shared gateway modes
7+
8+
As a cluster administrator you can configure the gateway mode using the `gatewayConfig` spec in the Cluster Network Operator. The following procedure can be used to set the `routingViaHost` field to `true` for local mode or `false` for shared mode.
9+
10+
You might follow the optional step 4 to enable IP forwarding alongside local gateway mode if you require node level traffic control. For example, possible use cases for combining local gateway mode with IP forwarding include:
11+
12+
* Configuring all pod egress traffic to be forwarded via the node's IP
13+
14+
* Integrating OVN-Kubernetes CNI with external network address translation (NAT) devices
15+
16+
* Configuring OVN-Kubernetes CNI to use a kernel routing table
17+
18+
19+
.Prerequisites
20+
* You are logged in as a user with admin privileges.
21+
22+
.Procedure
23+
24+
. Back up the existing network configuration by running the following command:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc get network.operator cluster -o yaml > network-config-backup.yaml
29+
----
30+
31+
. Set `routingViaHost` to `true` for local gateway mode by running the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc patch networks.operator.openshift.io cluster --type=merge -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"routingViaHost": true}}}}}'
36+
----
37+
38+
. Verify that local gateway mode has been set by running the following command:
39+
+
40+
[source,terminal]
41+
----
42+
$ oc get networks.operator.openshift.io cluster -o yaml | grep -A 5 "gatewayConfig"
43+
----
44+
+
45+
.Example output
46+
[source,terminal]
47+
----
48+
apiVersion: operator.openshift.io/v1
49+
kind: Network
50+
metadata:
51+
name: cluster
52+
# ...
53+
gatewayConfig:
54+
ipv4: {}
55+
ipv6: {}
56+
routingViaHost: true <1>
57+
genevePort: 6081
58+
ipsecConfig:
59+
# ...
60+
----
61+
<1> A value of `true` sets local gateway mode and a value of `false` sets shared gateway mode.
62+
63+
. Optional: Enable IP forwarding globally by running the following command:
64+
+
65+
[source,terminal]
66+
----
67+
$ oc patch network.operator cluster --type=merge -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}'
68+
----
69+
.. Verify that `ipForwarding` spec has been set to `Global` by running the following command:
70+
+
71+
[source,terminal]
72+
----
73+
$ oc get networks.operator.openshift.io cluster -o yaml | grep -A 5 "gatewayConfig"
74+
----
75+
+
76+
.Example output
77+
[source,terminal]
78+
----
79+
apiVersion: operator.openshift.io/v1
80+
kind: Network
81+
metadata:
82+
name: cluster
83+
# ...
84+
gatewayConfig:
85+
ipForwarding: Global
86+
ipv4: {}
87+
ipv6: {}
88+
routingViaHost: true
89+
genevePort: 6081
90+
# ...
91+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="configuring-gateway-mode"]
3+
= Configuring gateway mode
4+
include::_attributes/common-attributes.adoc[]
5+
:context: configuring-secondary-external-gateway
6+
7+
toc::[]
8+
9+
As a cluster administrator you can configure the `gatewayConfig` object to manage how external traffic leaves the cluster. You do so by setting the `routingViaHost` spec to `true` for shared mode or `false` for local mode.
10+
11+
In the shared mode traffic is forwarded from pods in the cluster to a shared centralized node where it exits the cluster. In the local mode, each node serves as its own gateway so that traffic exits from a pod through the node it is running on.
12+
13+
include::modules/nwt-gateway-mode.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)