Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit e42ba16

Browse files
committed
Smart Edge Open 22.05 release
1 parent e2e153d commit e42ba16

74 files changed

Lines changed: 2721 additions & 1915 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/networking/nodus.md

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
```text
2+
SPDX-License-Identifier: Apache-2.0
3+
Copyright (c) 2022 Intel Corporation
4+
```
5+
6+
# Nodus
7+
8+
## Overview
9+
10+
Nodus has been developed as one of [Akraino](https://www.lfedge.org/projects/akraino/) projects to provide Network Controller functionality and support wide range of Kubernetes networking use cases.
11+
It consists of four major components:
12+
- OVN control plane
13+
- OVN controller
14+
- Network Function Network(NFN) operator that runs in K8s control plane
15+
- Network Function Network (NFN) agent for K8s nodes
16+
17+
Nodus also provides a CNI plugin based on OVN and OpenVSwitch (OVS). It works with Multus CNI to provide pods with multiple interfaces.
18+
19+
One of the important features of Nodus is the ability to create virtual LAN networks on pod's interfaces at runtime. The CNI plugin also utilises physical interfaces to connect a pod to an external network (WAN) called a "provider network". This functionality is particularly important for SD-WAN CNFs used in the Intel® Smart Edge Open Secure Access Service Edge (SASE) experience kit. The CNF pods act as a proxy between the virtual LANs in the SASE Edge cluster and the WAN. Nodus is enabled by default in the SASE experience kit.
20+
To read about Nodus components and features go to [icn-nodus](https://github.com/akraino-edge-stack/icn-nodus).
21+
22+
## How It Works
23+
24+
Typically, in Kubernetes, each pod has only one network interface (apart from a loopback). With Multus, users can create a multi-homed pod that has multiple interfaces. To accomplish this, Multus acts as a “meta-plugin”, a CNI plugin that can call multiple other CNI plugins to add multiple interfaces to a pod. In the Intel® Smart Edge Open SASE experience kit, Nodus CNI is enabled by default as the secondary CNI whereas Calico act as the primary CNI. In such scenarios where Multus is used, net1 interface is by convention the OVN default interface that connects to Multus. The other interfaces (net2, net3, ...) are added by Nodus according to the pod annotation.
25+
26+
In a scenario where a CNF pod becomes a proxy between a virtual LAN in the Edge cluster and the WAN, it needs to have two types of interfaces configured:
27+
28+
- A virtual LAN network is configured and attached to one of the pod's virtual interfaces. This network connects application pods belonging to the same OVN network in the cluster. Nodus plugin allows for simplified creation of a virtual OVN network based on the provided configuration.
29+
- A provider network is configured to connect the pod to an external network (WAN). The provider network must be attached to the physical network infrastructure via layer-2 (i.e., via bridging/switching).
30+
31+
To learn about other supported scenarios and see examples of usage, go to [Nodus Usage Guide](https://github.com/akraino-edge-stack/icn-nodus/blob/master/doc/how-to-use.md).
32+
33+
## How To
34+
35+
### Create a virtual LAN network and a provider network
36+
37+
The following examples show sample definitions of a virtual LAN network and provider networks.
38+
39+
1. Vrtual LAN network
40+
```yaml
41+
apiVersion: k8s.plugin.opnfv.org/v1alpha1
42+
kind: Network
43+
metadata:
44+
name: ovn-port-net
45+
spec:
46+
cniType : ovn4nfv
47+
ipv4Subnets:
48+
- subnet: 172.16.33.0/24
49+
name: subnet1
50+
gateway: 172.16.33.1/24
51+
```
52+
( Source: [https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn-port-net.yaml](https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn-port-net.yaml) )
53+
54+
2. Provider network of type 'direct'
55+
```yaml
56+
apiVersion: k8s.plugin.opnfv.org/v1alpha1
57+
kind: ProviderNetwork
58+
metadata:
59+
name: directpnetwork
60+
spec:
61+
cniType: ovn4nfv
62+
ipv4Subnets:
63+
- subnet: 172.16.34.0/24
64+
name: subnet2
65+
gateway: 172.16.34.1/24
66+
excludeIps: 172.16.34.2 172.16.34.5..172.16.34.10
67+
providerNetType: DIRECT
68+
direct:
69+
providerInterfaceName: eth0.101
70+
directNodeSelector: specific
71+
nodeLabelList:
72+
- kubernetes.io/hostname=ubuntu18
73+
```
74+
( Source: [https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv_direct_pn.yml](https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv_direct_pn.yml) )
75+
76+
3. Provider network of type 'VLAN'
77+
```yaml
78+
apiVersion: k8s.plugin.opnfv.org/v1alpha1
79+
kind: ProviderNetwork
80+
metadata:
81+
name: vlanpnetwork
82+
spec:
83+
cniType: ovn4nfv
84+
ipv4Subnets:
85+
- subnet: 172.16.34.0/24
86+
name: subnet1
87+
gateway: 172.16.34.1/24
88+
excludeIps: 172.16.34.2 172.16.34.5..172.16.34.10
89+
providerNetType: VLAN
90+
vlan:
91+
vlanId: "100"
92+
providerInterfaceName: eth0
93+
logicalInterfaceName: eth0.100
94+
vlanNodeSelector: specific
95+
nodeLabelList:
96+
- kubernetes.io/hostname=ubuntu18
97+
```
98+
( Source: [https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv_vlan_pn.ym](https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv_vlan_pn.yml) )
99+
100+
To list defined networks, use:
101+
102+
```Shell.bash
103+
kubectl get networks
104+
```
105+
106+
### Create pods attached to a virtual network
107+
108+
Add an annotation to your pod definition in order to connect the pod replicas to a virtual network ('ovn-port-net')
109+
110+
```yaml
111+
apiVersion: apps/v1
112+
kind: Deployment
113+
metadata:
114+
name: nodus-deployment-vn
115+
labels:
116+
app: nodus-vn
117+
spec:
118+
replicas: 2
119+
selector:
120+
matchLabels:
121+
app: nodus-vn
122+
template:
123+
metadata:
124+
labels:
125+
app: nodus-vn
126+
annotations:
127+
k8s.v1.cni.cncf.io/networks: '[
128+
{ "name": "ovn4nfv-k8s-plugin",
129+
"interface": "net1"
130+
}]'
131+
k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [{ "name": "ovn-port-net", "interface": "net2" , "defaultGateway": "false"}'
132+
spec:
133+
containers:
134+
- name: nodus-deployment-vn
135+
image: "busybox"
136+
command: ["top"]
137+
stdin: true
138+
tty: true
139+
```
140+
( Source: [https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv-deployment-replica-2-with-multus-ovn4nfv-annotations.yam](https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv-deployment-replica-2-with-multus-ovn4nfv-annotations.yaml) )
141+
142+
#### Verify that the additional interfaces are configured on the pods
143+
144+
Run `ifconfig` in the deployed pod. The output should look similar to the following:
145+
146+
```Shell.bash
147+
eth0 Link encap:Ethernet HWaddr B6:66:62:E9:40:0F
148+
inet addr:10.233.64.14 Bcast:10.233.127.255 Mask:255.255.192.0
149+
UP BROADCAST RUNNING MULTICAST MTU:1400 Metric:1
150+
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
151+
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
152+
collisions:0 txqueuelen:0
153+
RX bytes:1026 (1.0 KiB) TX bytes:0 (0.0 B)
154+
155+
lo Link encap:Local Loopback
156+
inet addr:127.0.0.1 Mask:255.0.0.0
157+
UP LOOPBACK RUNNING MTU:65536 Metric:1
158+
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
159+
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
160+
collisions:0 txqueuelen:1000
161+
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
162+
163+
net1 Link encap:Ethernet HWaddr B6:66:62:10:D2:00:1F
164+
inet addr:10.210.0.30 Bcast:10.210.255.255 Mask:255.255.255.0
165+
UP BROADCAST RUNNING MULTICAST MTU:1400 Metric:1
166+
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
167+
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
168+
collisions:0 txqueuelen:0
169+
RX bytes:1026 (1.0 KiB) TX bytes:0 (0.0 B)
170+
171+
net2 Link encap:Ethernet HWaddr B6:66:62:10:21:03
172+
inet addr:172.16.33.2 Bcast:172.16.33.255 Mask:255.255.255.0
173+
UP BROADCAST RUNNING MULTICAST MTU:1400 Metric:1
174+
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
175+
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
176+
collisions:0 txqueuelen:0
177+
RX bytes:1026 (1.0 KiB) TX bytes:0 (0.0 B)
178+
```
179+
#### Test the network connectivity between the two pods:
180+
181+
Run `ping` command between the two pods specifying the interface connected to the virtual network ('ovn-port-net')
182+
183+
```Shell.bash
184+
# kubectl exec -it nodus-deployment-84f68d5474-6tsk7 -- ping 172.16.33.2
185+
PING 172.16.44.2 (172.16.33.4): 56 data bytes
186+
64 bytes from 172.16.33.2: seq=0 ttl=64 time=0.071 ms
187+
64 bytes from 172.16.33.2: seq=1 ttl=64 time=0.090 ms
188+
64 bytes from 172.16.33.2: seq=2 ttl=64 time=0.084 ms
189+
64 bytes from 172.16.33.2: seq=3 ttl=64 time=0.090 ms
190+
...
191+
```
192+
193+
### Create a pod attached to a provider network ('VLAN' or 'direct')
194+
Add an annotation to your pod definition in order to connect the pod to a provider network ('vlanpnetwork')
195+
196+
```yaml
197+
apiVersion: apps/v1
198+
kind: Deployment
199+
metadata:
200+
name: nodus-deploymen-pn
201+
labels:
202+
app: nodus-pn
203+
spec:
204+
replicas: 1
205+
selector:
206+
matchLabels:
207+
app: nodus-pn
208+
template:
209+
metadata:
210+
labels:
211+
app: nodus-pn
212+
annotations:
213+
k8s.v1.cni.cncf.io/networks: '[{ "name": "ovn-networkobj"}]'
214+
k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [{ "name": "vlanpnetwork", "interface": "net0" }]}'
215+
spec:
216+
containers:
217+
- name: nodus-deployment-pn
218+
image: "busybox"
219+
imagePullPolicy: Always
220+
stdin: true
221+
tty: true
222+
securityContext:
223+
privileged: true
224+
```
225+
( Source: [https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv_vlan_pn.yml](https://github.com/akraino-edge-stack/icn-nodus/blob/master/example/ovn4nfv_vlan_pn.yml) )
226+
227+
## Reference
228+
For further details on Nodus and more examples on usage go to:
229+
- Nodus: https://github.com/akraino-edge-stack/icn-nodus
230+
- Nodus Usage Guide: https://github.com/akraino-edge-stack/icn-nodus/blob/master/doc/how-to-use.md

0 commit comments

Comments
 (0)