Skip to content

Commit 1be2dad

Browse files
committed
Include route-override chained CNI plug-in
- #20605
1 parent bd0e1c3 commit 1be2dad

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,8 @@ Topics:
536536
File: edit-additional-network
537537
- Name: Removing an additional network
538538
File: remove-additional-network
539+
- Name: Overriding a route
540+
File: configuring-route-override
539541
- Name: Configuring PTP
540542
File: configuring-ptp
541543
- Name: Hardware networks
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-route-override.adoc
4+
5+
[id=""]
6+
= Configuring a route override
7+
8+
.Prerequisites
9+
10+
.Procedure
11+
12+
13+
[id="nw-multus-route-override-example_{context}"]
14+
== Specifying routes using the route-override CNI plugin
15+
16+
In addition to assigning IP addresses to pods, you can also override any routing on a given pod.
17+
18+
The "route-override" CNI plugin is used to accomplish this, and is used as a "chained plugin". To chain
19+
CNI plugins, you specify a list of CNI configurations. Only some plugins (such as route-override) can
20+
be utilized in this fashion, and are typically used to add capabilities or alter properties of additional
21+
network interfaces.
22+
23+
.Route-Override CNI chained CNI plug-in JSON configuration object
24+
[source,json]
25+
----
26+
{
27+
"cniVersion": "0.3.0",
28+
"name" : "exampleconfiguration",
29+
"plugins": [ <1>
30+
{
31+
"type": "...", <2>
32+
"ipam": {
33+
"type": "..."
34+
}
35+
},
36+
{
37+
"type" : "route-override", <3>
38+
"flushroutes" : true, <4>
39+
"addroutes": [ <5>
40+
{
41+
"dst": "192.168.10.0/24", <6>
42+
"gw": "10.1.254.254" <7>
43+
}],
44+
"delroutes": [ <8>
45+
{
46+
"dst": "192.168.0.0/24"
47+
}],
48+
"flushgateway": false, <9>
49+
}
50+
]
51+
}
52+
----
53+
54+
<1> When using chained plugins the `plugins` key should be a list of JSON objects
55+
<2> The first JSON object in the list will be the primary CNI plugin for the additional network.
56+
<3> The second JSON object should be set to `"type" : "route-override"` in order to alter routing. Required.
57+
<4> The `flushroutes` key, when set to true, will remove all existing routes from pods referencing this configuration. Optional.
58+
<5> The `addroutes` key is a list of JSON objects describing route destinations and gateways to be added. Optional.
59+
<6> The `dst` field in each `addroutes` object is the destination IP address and subnet mask in CIDR format.
60+
<7> The `gw` field is the gateway to set for each of the destination CIDR ranges. Optional.
61+
<8> The `delroutes` key is a list of JSON objects describing which destination routes to delete.
62+
<9> The `flushgateway` key when set to true, will remove the default gateway. Optional.
63+

modules/nw-multus-route-override-object.adoc

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[id="configuring-route-override"]
2+
= Overriding a route
3+
include::modules/common-attributes.adoc[]
4+
:context: configuring-route-override
5+
6+
toc::[]
7+
8+
As a cluster administrator, you can override the network routing configuration for a Pod, such as adding or deleting a route, flushing all routes, and flushing the default route.
9+
10+
[IMPORTANT]
11+
====
12+
If you misconfigure the routing table for a Pod, it might become unreachable from your cluster.
13+
====
14+
15+
include::modules/nw-multus-chained.adoc[leveloffset=+1]
16+
17+
include::modules/nw-multus-route-override-object.adoc[leveloffset=+1]
18+
19+
include::modules/nw-multus-route-override-create.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)