mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-29 13:15:30 +00:00
Update README.md
This commit is contained in:
parent
8f4252aee9
commit
c7ef591e30
79
README.md
79
README.md
@ -1,7 +1,6 @@
|
|||||||
|

|
||||||
# MULTUS CNI plugin
|
# MULTUS CNI plugin
|
||||||
|
|
||||||
Please read [CNI](https://github.com/containernetworking/cni) for more information on container networking.
|
|
||||||
|
|
||||||
- *Multus* is the latin word for “Multi”
|
- *Multus* is the latin word for “Multi”
|
||||||
|
|
||||||
- As the name suggests, it acts as the Multi plugin in the Kubernetes and provides the Multi interface support in a pod
|
- As the name suggests, it acts as the Multi plugin in the Kubernetes and provides the Multi interface support in a pod
|
||||||
@ -18,6 +17,7 @@ Please read [CNI](https://github.com/containernetworking/cni) for more informati
|
|||||||
|
|
||||||
- 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
|
- 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
|
||||||
|
|
||||||
|
Please read [CNI](https://github.com/containernetworking/cni) for more information on container networking.
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
@ -28,6 +28,10 @@ Go 1.5 users will need to set `GO15VENDOREXPERIMENT=1` to get vendored dependenc
|
|||||||
```
|
```
|
||||||
#./build
|
#./build
|
||||||
```
|
```
|
||||||
|
## Work flow
|
||||||
|
<p align="center">
|
||||||
|
<img src="doc/images/workflow.png" width="1008" />
|
||||||
|
</p>
|
||||||
## Network configuration reference
|
## Network configuration reference
|
||||||
|
|
||||||
* `name` (string, required): the name of the network
|
* `name` (string, required): the name of the network
|
||||||
@ -42,7 +46,7 @@ Given the following network configuration:
|
|||||||
```
|
```
|
||||||
# tee /etc/cni/net.d/multus-cni.conf <<-'EOF'
|
# tee /etc/cni/net.d/multus-cni.conf <<-'EOF'
|
||||||
{
|
{
|
||||||
"name": "minion1-multus-demo-network",
|
"name": "multus-demo-network",
|
||||||
"type": "multus",
|
"type": "multus",
|
||||||
"delegates": [
|
"delegates": [
|
||||||
{
|
{
|
||||||
@ -86,4 +90,71 @@ EOF
|
|||||||
|
|
||||||
```
|
```
|
||||||
## Testing the Multus CNI with docker
|
## 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)
|
Make sure that the multus, [sriov](https://github.com/Intel-Corp/sriov-cni), [flannel](https://github.com/containernetworking/cni/blob/master/Documentation/flannel.md), and [ptp](https://github.com/containernetworking/cni/blob/master/Documentation/ptp.md) binaries are in the `/opt/cni/bin` directories and follow the steps as mention in the [CNI](https://github.com/containernetworking/cni/#running-a-docker-container-with-network-namespace-set-up-by-cni-plugins)
|
||||||
|
|
||||||
|
## Testing the Multus CNI with Kubernetes
|
||||||
|
Refer the Kubernetes User Guide and network plugin
|
||||||
|
* [Single Node](https://kubernetes.io/docs/getting-started-guides/fedora/fedora_manual_config/)
|
||||||
|
* [Multi Node](https://kubernetes.io/docs/getting-started-guides/fedora/flannel_multi_node_cluster/)
|
||||||
|
* [Network Plugin](https://kubernetes.io/docs/admin/network-plugins/)
|
||||||
|
|
||||||
|
Kubelet must be configured to run with the CNI `--network-plugin`, with the following configuration information.
|
||||||
|
Edit `/etc/default/kubelet` file and add `KUBELET_OPTS`:
|
||||||
|
```
|
||||||
|
KUBELET_OPTS="...
|
||||||
|
--network-plugin-dir=/etc/cni/net.d
|
||||||
|
--network-plugin=cni
|
||||||
|
"
|
||||||
|
```
|
||||||
|
Restart the kubelet
|
||||||
|
```
|
||||||
|
# systemctl restart kubelet.service
|
||||||
|
```
|
||||||
|
### Launching workloads in Kubernetes
|
||||||
|
Launch the workload using yaml file in the kubernetes master, with above configuration in the multus CNI, each pod should have multiple interfaces.
|
||||||
|
> Note: To verify whether Multus CNI plugin is working fine create a pod containing one “busybox” container and execute “ip link” command to check if interfaces management follows configuration.
|
||||||
|
|
||||||
|
1. Create “multus-test.yaml” file containing below configuration. Created pod will consist of one “busybox” container running “top” command.
|
||||||
|
```
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: multus-test
|
||||||
|
spec: # specification of the pod's contents
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: test1
|
||||||
|
image: "busybox"
|
||||||
|
command: ["top"]
|
||||||
|
stdin: true
|
||||||
|
tty: true
|
||||||
|
|
||||||
|
```
|
||||||
|
2. Create pod using command:
|
||||||
|
```
|
||||||
|
# kubectl create -f multus-test.yaml
|
||||||
|
pod "multus-test" created
|
||||||
|
```
|
||||||
|
3. Run “ip link” command inside the container:
|
||||||
|
```
|
||||||
|
# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
|
||||||
|
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||||
|
3: eth0@if41: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue
|
||||||
|
link/ether 26:52:6b:d8:44:2d brd ff:ff:ff:ff:ff:ff
|
||||||
|
20: net0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
|
||||||
|
link/ether f6:fb:21:4f:1d:63 brd ff:ff:ff:ff:ff:ff
|
||||||
|
21: net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
|
||||||
|
link/ether 76:13:b1:60:00:00 brd ff:ff:ff:ff:ff:ff As seen in the above output 3 interfaces are created.
|
||||||
|
```
|
||||||
|
Interface name | Description
|
||||||
|
------------ | -------------
|
||||||
|
lo | loopback
|
||||||
|
eth0@if41 | Flannel network tap interface
|
||||||
|
net0 | VF assigned to the container by [SR_IOV CNI](https://github.com/Intel-Corp/sriov-cni) plugin
|
||||||
|
net1 | ptp localhost interface
|
||||||
|
|
||||||
|
### Contacts
|
||||||
|
For any questions about Multus CNI, please reach out on github issue or contact the developer
|
||||||
|
|
||||||
|
- Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
|
||||||
|
- David M O Neill <david.m.oneill@intel.com>
|
||||||
|
Loading…
Reference in New Issue
Block a user