6a77f6e8b936be26d681617fae2dd407a0801f80
[iec.git] / src / foundation / scripts / cni / multus / README.md
1 # Multus/SRIOV CNI&Device Plugin Support for IEC
2
3
4 ## Introduction
5 This commit provides Kubernetes networking support for Multus with SRIOV CNI support both on arm64 and amd64. A special configuration file for Broadcom smartNIC Stingray PS225 is provided as an example. So it can not only be used as a sample container networking support for Stingray PS225 with its sriov interfaces, but also a generic SRIOV support for various ethernet NICs.
6 Here we would like to provide 2 types legacy CNIs besides the SRIOV-CNI by Multus, which are [Flannel](https://coreos.com/flannel/docs/latest/kubernetes.html), and [Calico](https://docs.projectcalico.org/v3.11/introduction/).
7 They would be provided as the default CNIs for any pods without explicit annotations.
8
9 The work here is based on the following open source projects:
10 1. [Multus](https://github.com/intel/multus-cni)
11 1. [SRIOV Device Plugin](https://github.com/intel/sriov-network-device-plugin)
12 1. [SRIOV CNI](https://github.com/intel/sriov-cni)
13
14 For Broadcom Stingray PS225, please refer its [documents](https://github.com/CCX-Stingray/Documentation).
15
16
17 ## Initial setup
18
19 The SRIOV interfaces should be created before using the SRIOV CNI, for example, if the PF name of one of the Stingray PS225 ethernet NICs in your system is enp8s0f0np0, then you can lookup the maximum supported number of VFs under the PF and create the VFs with the command:
20
21 ```
22 #ip link set enp8s0f0np0 up
23 #cat /sys/class/net/enp8s0f0np0/device/sriov_totalvfs
24 16
25 #echo 16 > /sys/class/net/enp8s0f0np0/device/sriov_numvfs
26 ```
27 For SRIOV CNI with DPDK type drivers, such as vfio-pci, uio_pci_generic, please bind the driver by dpdk-devbind besides creating the VFs, for example:
28 ```dpdk-devbind.py -b vfio-pci enp12s2```
29 The `enp12s2` is the name of one of VFs of a ethernet NIC.
30
31 For more information, please refer the above links in the [Introduction](#Introduction).
32
33 ##Installation
34
35 There are 4 yaml files give:
36 1. configMap.yaml:
37 The resource list configuration file for SRIOV device plugin
38 1. multus-sriov-flannel-daemonsets.yaml
39 The Multus, SRIOV device plugin&CNI configuration file
40 1. flannel-daemonset.yml
41 The Flannel CNI installation file
42 1. sriov-crd.yaml
43 The SRIOV CNI configuration file for the attached SRIOV interface resource.
44
45 Usually users should modify the `configMap.yaml` and `sriov-crd.yaml` with their own corresponding networking configuration before doing the installation.
46
47 A quick installation script is given as `install.sh`, and the uninstallation could be done by call the `uninstall.sh`.
48
49 **The `install.sh` should be called after the Kubernetes cluster had been installed but before installing the CNIs.**
50
51 2 sample user pods yaml files using the SRIOV CNI are given also, please see `pod1.yaml` and `pod2.yaml` in the directory, and 2 iperfv2 based yaml files are also provided to facilitate the performance test. We choose IPerfv2 instead of the IPerfv3 because it seems can support multi-threaded sending/receiving. The 4 yaml files here are provided just for arm64 platform and they could easily be adapted to amd64 platform with corresponding images with a docker building based on the provided Dockerfile.iperf2 file.
52
53
54 ## Notes
55 Current installation files are suitable for K8s version less than 1.6, for that equal to or greater than 1.6, some modifications to the installation files should be done, which would adapt to the K8s api changes for newer versions.
56 We would try to give a sample installation file for k8s 1.6 or above in the future, but it had not tested now.
57
58 The command `kubectl get node $(hostname) -o json | jq '.status.allocatable'` can be used to check whether the allocated resources are available to use or not.
59
60 ## Other References
61 [Advanced Networking Features in
62 Kubernetes and Container Bare Metal](https://builders.intel.com/docs/networkbuilders/adv-network-features-in-kubernetes-app-note.pdf)
63
64 [Kubernetes: Multus + SRIOV quickstart](https://zshisite.wordpress.com/2018/11/15/kubernetes-multus-sriov-quickstart/)
65