1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00

OCPBUGS-51308 missing route-override CNI information

Updating based on SME review
This commit is contained in:
Kevin Quinn
2025-03-18 16:45:52 +00:00
committed by openshift-cherrypick-robot
parent 615e021e90
commit ebe5565170
4 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
// Module included in the following assemblies:
//
// * networking/multiple_networks/secondary_networks/creating-secondary-nwt-other-cni.adoc
// * networking/multiple_networks/configuring-additional-network.adoc
:_mod-docs-content-type: REFERENCE
[id="nw-route-override-cni_{context}"]
= Configuring routes using the route-override plugin on an additional network
The following object describes the configuration parameters for the `route-override` CNI plugin:
.Route override CNI plugin JSON configuration object
[cols=".^2,.^2,.^6",options="header"]
|====
|Field|Type|Description
|`type`
|`string`
|The name of the CNI plugin to configure: `route-override`.
|`flushroutes`
|`boolean`
|Optional: Set to `true` to flush any existing routes.
|`flushgateway`
|`boolean`
|Optional: Set to `true` to flush the default route namely the gateway route.
|`delroutes`
|`object`
|Optional: Specify the list of routes to delete from the container namespace.
|`addroutes`
|`object`
|Optional: Specify the list of routes to add to the container namespace. Each route is a dictionary with `dst` and optional `gw` fields. If `gw` is omitted, the plugin uses the default gateway value.
|`skipcheck`
|`boolean`
|Optional: Set this to `true` to skip the check command. By default, CNI plugins verify the network setup during the container lifecycle. When modifying routes dynamically with `route-override`, skipping this check ensures the final configuration reflects the updated routes.
|====
[id="nw-route-override-config-example_{context}"]
== Route-override plugin configuration example
The `route-override` CNI is a type of CNI that it is designed to be used when chained with a parent CNI. It does not operate independently, but relies on the parent CNI to first create the network interface and assign IP addresses before it can modify the routing rules.
The following example configures an additional network named `mymacvlan`. The parent CNI creates a network interface attached to `eth1` and assigns an IP address in the `192.168.1.0/24` range using `host-local` IPAM. The `route-override` CNI is then chained to the parent CNI and modifies the routing rules by flushing existing routes, deleting the route to `192.168.0.0/24`, and adding a new route for `192.168.0.0/24` with a custom gateway.
[source,json]
----
{
"cniVersion": "0.3.0",
"name": "mymacvlan",
"plugins": [
{
"type": "macvlan", <1>
"master": "eth1",
"mode": "bridge",
"ipam": {
"type": "host-local",
"subnet": "192.168.1.0/24"
}
},
{
"type": "route-override", <2>
"flushroutes": true,
"delroutes": [
{
"dst": "192.168.0.0/24"
}
],
"addroutes": [
{
"dst": "192.168.0.0/24",
"gw": "10.1.254.254"
}
]
}
]
}
----
<1> The parent CNI creates a network interface attached to `eth1`.
<2> The chained `route-override` CNI modifies the routing rules.

View File

@@ -15,6 +15,7 @@ As a cluster administrator, you can configure an additional network for your clu
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#nw-multus-macvlan-object_configuring-additional-network[MACVLAN]
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#nw-multus-tap-object_configuring-additional-network[TAP]
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#configuration-ovnk-additional-networks_configuring-additional-network[OVN-Kubernetes]
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#nw-route-override-cni_configuring-additional-network[Route-override]
[id="approaches-managing-additional-network_{context}"]
== Approaches to managing an additional network
@@ -177,6 +178,9 @@ include::modules/nw-multus-macvlan-object.adoc[leveloffset=+2]
// Configuration for a TAP additional network
include::modules/nw-multus-tap-object.adoc[leveloffset=+2]
// Configuration for route-override additional network
include::modules/nw-route-override-cni.adoc[leveloffset=+2]
[role="_additional-resources"]
.Additional resources

View File

@@ -26,6 +26,9 @@ include::modules/nw-multus-macvlan-object.adoc[leveloffset=+1]
// Configuration for a TAP additional network
include::modules/nw-multus-tap-object.adoc[leveloffset=+1]
// Configuration for a route-override additional network
include::modules/nw-route-override-cni.adoc[leveloffset=+1]
[role="_additional-resources"]
.Additional resources

View File

@@ -69,6 +69,8 @@ networks in your cluster:
* *SR-IOV*: xref:../../networking/hardware_networks/about-sriov.adoc#about-sriov[Configure an SR-IOV based additional network] to allow pods to attach to a virtual function (VF) interface on SR-IOV capable hardware on the host system.
* *route-override*: xref:../../networking/multiple_networks/secondary_networks/creating-secondary-nwt-other-cni.adoc#nw-route-override-cni_configuring-additional-network-cni[Configure a `route-override` based additional network] to allow pods to override and set routes.
include::modules/nw-udn-support-matrix-primary-secondary.adoc[leveloffset=+1]
.Additional resources