|
| 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 | + |
0 commit comments