
This plugin allows to create a VRF with the given name (or use the existing one if any) in the target namespace, and to allocate the interface to it. VRFs make it possible to use multiple routing tables on the same namespace and allows isolation among interfaces within the same namespace. On top of that, this allow different interfaces to have overlapping CIDRs (or even addresses). This is only useful in addition to other plugins. The configuration is pretty simple and looks like: { "type": "vrf", "vrfname": "blue" } Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
vrf plugin
Overview
This plugin creates a VRF in the network namespace and assigns it the interface passed in the arguments. If the VRF is already present in the namespace, it only adds the interface to it.
As a table id is mandatory, the plugin generates a new one for each different VRF that is added to the namespace.
It does not create any network interfaces and therefore does not bring connectivity by itself. It is only useful when used in addition to other plugins.
Operation
The following network configuration file
{
"cniVersion": "0.3.1",
"name": "macvlan-vrf",
"plugins": [
{
"type": "macvlan",
"master": "eth0",
"ipam": {
"type": "dhcp"
}
},
{
"type": "vrf",
"vrfname": "blue",
}
]
}
will create a VRF named blue inside the target namespace (if not existing), and set it as master of the interface created by the previous plugin.
Configuration
The only configuration is the name of the VRF, as per the following example:
{
"type": "vrf",
"vrfname": "blue"
}
Supported arguments
The following args conventions are supported:
vrfname
(string, optional): The name of the VRF to be created and to be set as master of the interface