1 .. Copyright 2018 Intel Corporation.
2 Licensed under the Apache License, Version 2.0 (the "License");
3 you may not use this file except in compliance with the License.
4 You may obtain a copy of the License at
5 http://www.apache.org/licenses/LICENSE-2.0
6 Unless required by applicable law or agreed to in writing, software
7 distributed under the License is distributed on an "AS IS" BASIS,
8 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 See the License for the specific language governing permissions and
10 limitations under the License.
13 OVN4NFVK8s Plugin/nfn-operator (Network Function Networking operator)
19 Networking applications are of three types - Management applications,
20 Control plane applications and data plane applications. Management
21 and control plane applications are similar to Enterprise applications,
22 but data plane applications different in following aspects:
24 - Multiple virtual network interfaces
25 - Multiple IP addresses
26 - SRIOV networking support
27 - Programmable virtual switch (for service function chaining, to tap
28 the traffic for visibility etc..)
30 Kubernetes (Simply K8S) is the most popular container orchestrator.
31 K8S is supported by GCE, AZURE and AWS and will be supported by
32 Akraino Edge stack that enable edge clouds.
34 K8S has being enhanced to support VM workload types, this helps
35 cloud providers that need to migrate legacy workloads to microservices
36 architecture. Cloud providers may continue to support VM workload
37 types for security reasons and hence there is need for VIM that
38 support both VMs and containers. Since same K8S instance can
39 orchestrate both VM and container workload types, same compute nodes
40 can be leveraged for both VMs and containers. Telco and CSPs are
41 seeing similar need to deploy networking applications as containers.
43 Since, both VMs and container workloads are used for networking
44 applications, there would be need for
46 - Sharing the networks across VMs and containers.
47 - Sharing the volumes across VMs and containers.
49 **Network Function Virtualization Requirements**
53 - Management plane workloads
54 - Control plane work loads
55 - User plane (data plane workloads)
56 - User plane workloads normally have
57 - Multiple interfaces, Multiple subnets, Multiple virtual networks
58 - NFV workloads typically have its own management network.
59 - Some data plane workloads require SR-IOV NIC support for data
60 interfaces and virtual NIC for other interfaces (for performance
62 - Need for multiple CNIs.
63 - NFV workloads require dynamic creation of virtual networks. Dynamic
64 configuration of subnets.
69 This plugin addresses the below requirements, for networking
70 workloads as well typical application workloads
71 - Multi-interface support
72 - Multi-IP address support
73 - Dynamic creation of virtual networks
74 - Co-existing with SRIOV and other CNIs.
75 - Route management across virtual networks and external networks
79 OVN, the Open Virtual Network, is a system to support virtual network
80 abstraction. OVN complements the existing capabilities of OVS to add
81 native support for virtual network abstractions, such as virtual L2
82 and L3 overlays and security groups. Services such as DHCP are also
83 desirable features. Just like OVS, OVN’s design goal is to have a
84 production quality implementation that can operate at significant
87 **OVN4NFVK8s Plugin/ NFN-Operator development**
89 ovn-kubernetes_ plugin is part of OVN project which provides OVN
90 integration with Kubernetes but doesn't address the requirements
91 as given above. To meet those requirements like multiple interfaces,
92 IPs, dynamic creation of virtual networks, etc., OVN4NFVK8s plugin/
93 nfn-operator is created. It assumes that it will be used in
94 conjuction with Multus_or other similar CNI which allows for the
95 co-existance of multipleCNI plugins in runtime. This plugin assumes
96 that the first interface in a Pod is provided by some other Plugin/CNI
97 like Flannel or even OVN-Kubernetes. It is only responsible to add
98 multiple interfacesbased on the Pod annotations. The code is based on
101 NFN-Operator has following functionalities:
102 1) It watches pods for annotations (see below)
103 2) It is a CRD Controller for dynamic networks, provider networks and
104 dynamic route creation.
105 3) It is a gRPC server for nfn-agent running on all nodes in the cluster
107 nfn-operator uses operator-sdk and controller runtime for watching for
108 pods and also other CR's. For creating dynamic logical networks Network
109 CRD controller creates OVN logical switch as defined in CR. For provider
110 network creation Provider Network CRD controller works with nfn-agent
111 running on nodes to create provider network. nfn-operator communicates
112 with nfn agent using gRPC. Currently only VLAN based provider networks
117 This plugin is currently tested to work with Multus and Flannel
118 providing the first network interface.
120 To meet the requirement of multiple interfaces and IP's per pod,
121 a Pod annotation like below is required when working with Multus:
128 k8s.v1.cni.cncf.io/networks: '[{ "name": "ovn-networkobj"}]'
129 k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
130 { "name": <name of OVN Logical Switch>, "interfaceRequest": "eth1" },
131 { "name": <name of OVN Logical Switch>, "interfaceRequest": "eth2" }
134 Based on these annotations watcher service in OVN4NFVK8s plugin/
135 nfn-operator assumes logical switch is already present. Dynamic IP
136 addresses are assigned (static IP's also supported) and annotations
139 When the Pod is initialized on a node, OVN4NFVK8s CNI creates multiple
140 interfaces and assigns IP addresses for the pod based on the annotations.
142 **Multus Configuration**
143 Multus CRD definition for OVN:
147 apiVersion: "k8s.cni.cncf.io/v1"
148 kind: NetworkAttachmentDefinition
153 "cniVersion": "0.3.1",
154 "name": "ovn4nfv-k8s-plugin",
155 "type": "ovn4nfvk8s-cni"
158 Please refer to Multus_ for details about how this configuration is used
160 CNI configuration file for Multus with Flannel:
166 "name": "multus-cni",
167 "cniVersion": "0.3.1",
168 "kubeconfig": "/etc/kubernetes/admin.conf",
172 "cniVersion": "0.3.1",
173 "masterplugin": true,
175 "isDefaultGateway": false
181 Refer Kubernetes_ documentation for the order in which CNI configurations
187 For building the project:
191 cd ovn4nfv-k8s-plugin
195 This will output two files nfn-operator, nfn-agent and ovn4nfvk8s-cni which are the plugin/
196 operator, gRPC client and CNI binaries respectively.
198 ovn4nfvk8s-cni requires some configuration at start up.
200 Example configuration file (default location/etc/openvswitch/ovn4nfv_k8s.conf)
206 logfile=/var/log/openvswitch/ovn4k8s.log
209 conf-dir=/etc/cni/net.d
210 plugin=ovn4nfvk8s-cni
213 kubeconfig=/etc/kubernetes/admin.conf
220 nfn-operator includes controllers for 3 types of CRDs:
222 1) Network CRD - To create logical networks.
224 2) Provider Network CRD - To Create Provider networks. This works along with nfn-agent
225 to create provider networks on nodes in cluster as needed.
227 3) Chaining operator - To provision routes in Pods as per CR definition.
231 **Network CR Example**
236 apiVersion: k8s.plugin.opnfv.org/v1alpha1
239 name: example-network
244 - subnet: 172.16.44.0/24
246 gateway: 172.16.44.1/24
247 excludeIps: 172.16.44.2 172.16.44.5..172.16.44.10
251 **Provider Network CR Example**
256 apiVersion: k8s.plugin.opnfv.org/v1alpha1
257 kind: ProviderNetwork
263 - subnet: 172.16.33.0/24
265 excludeIps: 172.16.33.2 172.16.33.5..172.16.33.10
266 providerNetType: VLAN
269 providerInterfaceName: eth1
270 logicalInterfaceName: eth1.100
271 vlanNodeSelector: specific
273 - kubernetes.io/hostname=testnode1
275 **Chaining CR Example**
287 | | Program OVN Switch
288 |ovn4nfvk8s Plugin| +------------------+
289 | +--------------------->| |
292 | | +------------------+
296 |On Event |Annotate Pod
299 +----+--------------+ +------------------+ +-----------+
301 | Kube API +--------> Kube Scheduler +---------->| |
302 | | | | +--------+--+
303 | | +--------+---------+ |
304 +-------------------+ | |
307 +--------v-----------+ |
310 | +------------------+
311 +--------------------+
318 .. _ovn-kubernetes: https://github.com/openvswitch/ovn-kubernetes
319 .. _Multus: https://github.com/intel/multus-cni
320 .. _Kubernetes: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/
322 **Authors/Contributors**
324 Addepalli, Srinivasa R <srinivasa.r.addepalli@intel.com>
325 Sood, Ritu <ritu.sood@intel.com>