Federico Paolinelli 5fc309a699 Add more tests for the vrf cni plugin.
The new tests expand coverage, checking deletion, ip address handling,
0.4.0 compatibility, behaviour in case of multiple vrfs.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-21 17:59:01 +02:00
..
2020-10-14 17:40:50 +02:00
2020-10-14 17:40:50 +02:00
2020-10-14 17:40:50 +02:00

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