From 62df34162ef72710a3e532d8fb489cbb78ffc594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=97=A5=E6=98=8E?= Date: Tue, 2 Nov 2021 14:34:32 +0800 Subject: [PATCH] update docs --- docs/multi-nic.md | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/docs/multi-nic.md b/docs/multi-nic.md index ced19a2e5b4..76fc33dcae9 100644 --- a/docs/multi-nic.md +++ b/docs/multi-nic.md @@ -236,8 +236,6 @@ spec: image: alpine ``` -Note that the pod cannot be assigned the same subnet, the above example assumes that kube-ovn is not the default network. - ### Create pod with specified subnet For allocation from the specified subnet: @@ -276,3 +274,41 @@ spec: command: ["/bin/ash", "-c", "trap : TERM INT; sleep infinity & wait"] image: alpine ``` + +### Create pod with multiple interface and alloc the same subnet +For allocation from the same subnet to multiple interface: + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: spec-subnet + namespace: default + annotations: + k8s.v1.cni.cncf.io/networks: default/attachnet + attachnet.default.ovn.kubernetes.io/logical_switch: my-subnet # ..ovn.kubernetes.io/logical_switch + ovn.kubernetes.io/logical_switch: my-subnet +spec: + containers: + - name: spec-subnet + command: ["/bin/ash", "-c", "trap : TERM INT; sleep infinity & wait"] + image: alpine +``` + +The same subnet will be alloc to multiple interface: + +```shell +/ # ip a +995: eth0@if996: mtu 1400 qdisc noqueue state UP group default + link/ether 00:00:00:ea:74:5f brd ff:ff:ff:ff:ff:ff link-netnsid 0 + inet 10.16.0.14/16 brd 10.16.255.255 scope global eth0 + valid_lft forever preferred_lft forever + inet6 fe80::200:ff:feea:745f/64 scope link + valid_lft forever preferred_lft forever +997: net1@if998: mtu 1400 qdisc noqueue state UP group default + link/ether 00:00:00:d1:d4:1b brd ff:ff:ff:ff:ff:ff link-netnsid 0 + inet 10.16.0.10/16 brd 10.16.255.255 scope global net1 + valid_lft forever preferred_lft forever + inet6 fe80::200:ff:fed1:d41b/64 scope link + valid_lft forever preferred_lft forever +``` \ No newline at end of file