Skip to content

Include route-override chained CNI plug-in #23108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _topic_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ Topics:
File: edit-additional-network
- Name: Removing an additional network
File: remove-additional-network
- Name: Overriding a route
File: configuring-route-override
- Name: Configuring PTP
File: configuring-ptp
- Name: Hardware networks
Expand Down
63 changes: 63 additions & 0 deletions modules/nw-multus-route-override-create.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Module included in the following assemblies:
//
// * networking/multiple_networks/configuring-route-override.adoc

[id=""]
= Configuring a route override

.Prerequisites

.Procedure


[id="nw-multus-route-override-example_{context}"]
== Specifying routes using the route-override CNI plugin

In addition to assigning IP addresses to pods, you can also override any routing on a given pod.

The "route-override" CNI plugin is used to accomplish this, and is used as a "chained plugin". To chain
CNI plugins, you specify a list of CNI configurations. Only some plugins (such as route-override) can
be utilized in this fashion, and are typically used to add capabilities or alter properties of additional
network interfaces.

.Route-Override CNI chained CNI plug-in JSON configuration object
[source,json]
----
{
"cniVersion": "0.3.0",
"name" : "exampleconfiguration",
"plugins": [ <1>
{
"type": "...", <2>
"ipam": {
"type": "..."
}
},
{
"type" : "route-override", <3>
"flushroutes" : true, <4>
"addroutes": [ <5>
{
"dst": "192.168.10.0/24", <6>
"gw": "10.1.254.254" <7>
}],
"delroutes": [ <8>
{
"dst": "192.168.0.0/24"
}],
"flushgateway": false, <9>
}
]
}
----

<1> When using chained plugins the `plugins` key should be a list of JSON objects
<2> The first JSON object in the list will be the primary CNI plugin for the additional network.
<3> The second JSON object should be set to `"type" : "route-override"` in order to alter routing. Required.
<4> The `flushroutes` key, when set to true, will remove all existing routes from pods referencing this configuration. Optional.
<5> The `addroutes` key is a list of JSON objects describing route destinations and gateways to be added. Optional.
<6> The `dst` field in each `addroutes` object is the destination IP address and subnet mask in CIDR format.
<7> The `gw` field is the gateway to set for each of the destination CIDR ranges. Optional.
<8> The `delroutes` key is a list of JSON objects describing which destination routes to delete.
<9> The `flushgateway` key when set to true, will remove the default gateway. Optional.

Empty file.
19 changes: 19 additions & 0 deletions networking/multiple_networks/configuring-route-override.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[id="configuring-route-override"]
= Overriding a route
include::modules/common-attributes.adoc[]
:context: configuring-route-override

toc::[]

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.

[IMPORTANT]
====
If you misconfigure the routing table for a Pod, it might become unreachable from your cluster.
====

include::modules/nw-multus-chained.adoc[leveloffset=+1]

include::modules/nw-multus-route-override-object.adoc[leveloffset=+1]

include::modules/nw-multus-route-override-create.adoc[leveloffset=+1]