Skip to content

Commit 51a03ad

Browse files
authored
Merge pull request #103483 from dfitzmau/OCPBUGS-61017-16
[enterprise-4.16] OCPBUGS-61017: Updated the NMState docs with routes and route rules docs
2 parents 864300b + f5f4cdd commit 51a03ad

File tree

3 files changed

+75
-43
lines changed

3 files changed

+75
-43
lines changed

modules/virt-example-nmstate-IP-management.adoc

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -288,43 +288,3 @@ interfaces:
288288
auto-dns: true
289289
# ...
290290
----
291-
292-
[id="virt-example-nmstate-IP-management-static-routing_{context}"]
293-
== Static routing
294-
295-
The following snippet configures a static route and a static IP on interface `eth1`.
296-
297-
[source,yaml]
298-
----
299-
dns-resolver:
300-
config:
301-
# ...
302-
interfaces:
303-
- name: eth1
304-
description: Static routing on eth1
305-
type: ethernet
306-
state: up
307-
ipv4:
308-
dhcp: false
309-
enabled: true
310-
address:
311-
- ip: 192.0.2.251 <1>
312-
prefix-length: 24
313-
routes:
314-
config:
315-
- destination: 198.51.100.0/24
316-
metric: 150
317-
next-hop-address: 192.0.2.1 <2>
318-
next-hop-interface: eth1
319-
table-id: 254
320-
# ...
321-
----
322-
<1> The static IP address for the Ethernet interface.
323-
<2> The next hop address for the node traffic. This must be in the same subnet as the IP address set for the Ethernet interface.
324-
325-
[IMPORTANT]
326-
====
327-
You cannot use the OVN-Kubernetes `br-ex` bridge as the next hop interface when configuring a static route unless you manually configured a customized `br-ex` bridge.
328-
329-
For more information, see "Creating a manifest object that includes a customized br-ex bridge" in the _Deploying installer-provisioned clusters on bare metal_ document or the _Installing a user-provisioned cluster on bare metal_ document.
330-
====
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="virt-routes-route-rules_{context}"]
7+
= Routes and route rules
8+
9+
[role="_abstract"]
10+
After you configure an IP address for a network interface, you can configure routes and route rules in the NMState configuration for cluster nodes.
11+
12+
[IMPORTANT]
13+
====
14+
You cannot use the OVN-Kubernetes `br-ex` bridge as the next hop interface when configuring a static route unless you manually configured a customized `br-ex` bridge.
15+
16+
For more information, see "Creating a manifest object that includes a customized br-ex bridge" in the _Deploying installer-provisioned clusters on bare metal_ document or the _Installing a user-provisioned cluster on bare metal_ document.
17+
====
18+
19+
The `routes` parameter defines static routes and these routes determine the traffic that leaves the network interfaces and the destination network for the traffic. Supported values include `running` and `config`.
20+
21+
[NOTE]
22+
====
23+
After you apply an NMState configuration to cluster nodes and you want to change existing routes, you must specify the old route with the `state: absent` parameter and the new route with the `state: present` parameter. The NMState Operator can then delete the old route and apply the new route to cluster nodes.
24+
25+
Setting the `state` parameter to `ignore` means that the Operator ignores certain routes.
26+
====
27+
28+
The `route-rules` parameter implements a policy-based routing capability for cluster nodes. This capability allows traffic that originates from a different source IP address to be segregated and routed through different gateways and network paths.
29+
30+
The following YAML configuration shows a static route and a static IP confiuration on interface `eth1`:
31+
32+
[source,yaml]
33+
----
34+
dns-resolver:
35+
config:
36+
# ...
37+
interfaces:
38+
- name: eth1
39+
description: Static routing on eth1
40+
type: ethernet
41+
state: up
42+
ipv4:
43+
dhcp: false
44+
enabled: true
45+
address:
46+
- ip: 192.0.2.251
47+
prefix-length: 24
48+
route-rules:
49+
config:
50+
- ip-from: 198.51.100.0/24
51+
priority: 1000
52+
route-table: 200
53+
routes:
54+
config:
55+
- destination: 198.51.100.0/24
56+
next-hop-interface: eth1
57+
next-hop-address: 192.0.2.1
58+
metric: 150
59+
table-id: 200
60+
# ...
61+
----
62+
* `config.ip-from`: Applies a rule to any network packet that originates from the specified IP address.
63+
* `config.priority`: Sets the priority order for the rule.
64+
* `config.route-table`: Specifies the routing table that the Operator uses to check that network traffic matches the `ip-from` condition.
65+
* `address.ip`: The static IP address for the Ethernet interface.
66+
* `config.next-hop-address`: The next hop address for the node traffic. This must be in the same subnet as the IP address set for the Ethernet interface.
67+

networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include::_attributes/common-attributes.adoc[]
77

88
toc::[]
99

10-
After you install the Kubernetes NMState Operator, you can use the Operator to observe and update your cluster's node network state and network configuration.
10+
After you install the Kubernetes NMState Operator, you can use the Operator to observe and update the node network state and network configuration of the cluster.
1111

1212
For more information about how to install the NMState Operator, see xref:../../networking/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator#k8s-nmstate-about-the-k8s-nmstate-operator[Kubernetes NMState Operator].
1313

@@ -131,9 +131,14 @@ include::modules/virt-example-inherit-static-ip-from-nic.adoc[leveloffset=+2]
131131
// Examples: IP management
132132
include::modules/virt-example-nmstate-IP-management.adoc[leveloffset=+1]
133133

134+
// Routes and route tables
135+
include::modules/virt-routes-route-rules.adoc[leveloffset=+1]
136+
134137
[role="_additional-resources"]
135138
.Additional resources
136139

137-
* xref:../../installing/installing_bare_metal_ipi/ipi-install-installation-workflow.adoc#creating-manifest-file-customized-br-ex-bridge_ipi-install-installation-workflow[Creating a manifest object that includes a customized br-ex bridge (Installer-provisioned infrastructure)]
138-
139140
* xref:../../installing/installing_bare_metal/installing-bare-metal.adoc#creating-manifest-file-customized-br-ex-bridge_installing-bare-metal[Creating a manifest object that includes a customized br-ex bridge (User-provisioned infrastructure)]
141+
142+
* link:https://nmstate.io/devel/yaml_api.html#routes[Routes (nmstate documentation)]
143+
144+
* link:https://nmstate.io/devel/yaml_api.html#route-rules[Route Rules (nmstate documentation)]

0 commit comments

Comments
 (0)