2016-12-13 14:48:12 +00:00
# MULTUS CNI plugin
2016-12-13 16:05:52 +00:00
Please read [CNI ](https://github.com/containernetworking/cni ) for more information on container networking.
2016-12-13 14:48:12 +00:00
2016-12-13 18:21:42 +00:00
- *Multus* is the latin word for “Multi”
2016-12-13 14:48:12 +00:00
2016-12-13 22:26:29 +00:00
- As the name suggests, it acts as the Multi plugin in the Kubernetes and provides the Multi interface support in a pod
2016-12-13 14:48:12 +00:00
2016-12-13 18:21:42 +00:00
- It is generic to run with other plugins like ptp, local-host, calico and flannel, with different IPAM and networks.
2016-12-13 14:48:12 +00:00
2016-12-13 22:26:29 +00:00
- It contact between the container runtime and other plugins, and it isn't having any of it own net configuration, it calls other plugins like flannel/calico to do the real net conf job.
2016-12-13 18:21:42 +00:00
- Multus reuse the concept of invoking the delegates in the flannel, it group the multi plugins into delegates and invoke each other in the sequential order, according to the JSON scheme in the cni configuration.
2016-12-13 14:48:12 +00:00
2016-12-13 22:26:29 +00:00
- No of plugins support is depending upon the number of delegates in the conf file.
2017-02-21 17:11:19 +00:00
- Master plugin invokes "eth0" interface in the pod, rest of plugins(Mininon plugins eg: sriov,ipam) invoke interfaces as "net0", "net1".. "netn"
- The "masterplugin" is the only net conf option of multus cni, it identifies the primary network. The default route will point to the primary network
2016-12-13 14:48:12 +00:00
## Build
This plugin requires Go 1.5+ to build.
Go 1.5 users will need to set `GO15VENDOREXPERIMENT=1` to get vendored dependencies. This flag is set by default in 1.6.
```
#./build
```
## Network configuration reference
* `name` (string, required): the name of the network
* `type` (string, required): "multus"
2016-12-13 22:50:25 +00:00
* `delegates` (([]map,required): number of delegate details in the Multus
2016-12-13 22:26:29 +00:00
* `masterplugin` (bool,required): master plugin to report back the IP address and DNS to the container
2016-12-13 14:48:12 +00:00
## Usage
Given the following network configuration:
```
2016-12-13 16:04:27 +00:00
# tee /etc/cni/net.d/multus-cni.conf <<-'EOF'
2016-12-13 14:48:12 +00:00
{
"name": "minion1-multus-demo-network",
"type": "multus",
"delegates": [
{
"type": "sriov",
2017-02-21 17:11:19 +00:00
#part of sriov plugin conf
"if0": "enp12s0f0",
2016-12-13 14:48:12 +00:00
"ipam": {
"type": "host-local",
"subnet": "10.56.217.0/24",
"rangeStart": "10.56.217.131",
"rangeEnd": "10.56.217.190",
"routes": [
{ "dst": "0.0.0.0/0" }
],
"gateway": "10.56.217.1"
}
},
{
2017-02-21 17:11:19 +00:00
"type": "ptp",
2016-12-13 14:48:12 +00:00
"ipam": {
"type": "host-local",
2017-02-21 17:11:19 +00:00
"subnet": "10.168.1.0/24",
"rangeStart": "10.168.1.11",
"rangeEnd": "10.168.1.20",
2016-12-13 14:48:12 +00:00
"routes": [
{ "dst": "0.0.0.0/0" }
],
2017-02-21 17:11:19 +00:00
"gateway": "10.168.1.1"
2016-12-13 14:48:12 +00:00
}
},
{
"type": "flannel",
"masterplugin": true,
"delegate": {
"isDefaultGateway": true
}
}
]
}
EOF
```
2016-12-13 16:10:15 +00:00
## Testing the Multus CNI with docker
Make sure that the multus, [sriov ](https://github.com/Intel-Corp/sriov-cni ) and [flannel ](https://github.com/containernetworking/cni/blob/master/Documentation/flannel.md ) binaries are in the /opt/cni/bin directories and follow the steps as mention in the [CNI ](https://github.com/containernetworking/cni )