Home

Awesome

route-override: Meta CNI plugin for overriding IP route

Travis CI

Overview

route-override IPAM works as meta CNI plugin to override IP route given by previous CNI plugins. It is useful in a case with network-attachment-definition.

Supported runtime

Currently route-override verified its feature with podman and crio(with Kubernetes).

Download

Binaries (for 386/amd64) are in Releases.

Install via daemonset

Installing using the provided daemonset will copy the route-override binary to the /opt/cni/bin on each machine in your Kubernetes cluster.

git clone https://github.com/redhat-nfvpe/cni-route-override.git && cd cni-route-override/
kubectl create -f deployments/daemonset-install.yaml

Example Configuration

{
    "cniVersion": "0.3.0",
    "name" : "mymacvlan",
    "plugins": [
    {
        "type": "macvlan",
        "master": "eth1",
        "mode": "bridge",
        "ipam": {
            ...
        }
    },
    {
        "type" : "route-override",
        "flushroutes" : true,
        "delroutes": [
        {
            "dst": "192.168.0.0/24"
        }],
        "addroutes": [
        {
            "dst": "192.168.0.0/24",
            "gw": "10.1.254.254"
        }]
    }
    ]
}

Configuration Reference

Process Sequence

route-override will manipulate the routes as following sequences:

  1. flush routes if flushroutes is enabled.
  2. flush gateway if flushgateway is enabled.
  3. delete routes in delroutes if delroutes has route and the route is exists in routes.
  4. add routes in addroutes if addroutes has route.

Supported Arguments

The following args conventions are supported: