...
High Level Architecture for the Networking Plugin
Networking Plugin
The Networking Plugin has the ability to create, delete, query and update virtual networks. This will implement API's like CreateVL, DeleteVL, QueryVL and UpdateVL. Networking plugin on initialization will call discovery function to find out about the type of networking plugin available. It'll load the required plugin and call init functions of the appropriate plugin.
...
One of the requirements for VNF's is to support multiple virtual network interfaces and multiple IP addresses. Multus acts as a Multi plugin in Kubernetes and provides the multiple network interface support in a pod. https://github.com/intel/multus-cni. It'll be used in this project to provide a default management port based on Flannel to all VNF's. The other interfaces will all be based on ovn-kubernetes as discussed in the next section.
...
Create following network resource for OVN.
OVN network resources in Kubernetes:
apiVersion: "kubernetes.cni.cncf.io/v1"
kind: Network
metadata:
name: ovn-network
spec:
config: '{
"name": "ovn-kubernetes",
"type": "ovn-k8s-cni-overlay"
}'
...
spec: # specification of the pod's contents
containers:
- name: pod-ovn
image: "busybox"
command: ["top"]
stdin: true
tty: true
Configuration details
Custom Resource Definition for ONAP Network(CRD) :
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
# name must match the spec fields below, and be in the form: <plural>.<group>
name: onapnetworks.kubernetes.onap.io
spec:
# group name to use for REST API: /apis/<group>/<version>
group: kubernetes.onap.io
# version name to use for REST API: /apis/<group>/<version>
version: v1
# either Namespaced or Cluster
scope: Namespaced
names:
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
plural: onapnetworks
# singular name to be used as an alias on the CLI and for display
singular: onapnetwork
# kind is normally the CamelCased singular type. Your resource manifests use this.
kind: onapNetwork
# shortNames allow shorter string to match your resource on the CLI
shortNames:
- onapnet
ONAP Network Definition :
apiVersion: "kubernetes.onap.io/v1"
kind: onapNetwork
metadata:
name: ovn-ls-24
spec:
config: '{
"name": " ovn-ls-24",
"subnet": " 172.16.24.0/24",
"gateway": " 172.16.24.1"
}'
Pod/Service annotation:
apiVersion: v1
kind: Pod
metadata:
name: pod-ovn
annotations:
kubernetes.v1.cni.cncf.io/networks: '[{ "name": "ovn-network"}]'
kubernetes.v1.onap.io/onapnetworks:
{
"ovnNetwork":[
{
"name":"ovn-ls-26",
"interface":"net0",
"defaultGateway":"true"
},
{
"name":"ovn-ls-24",
"interface":"net1",
"defaultGateway":"false",
"ip_address":"172.16.24.2/24",
"mac_address":"0a:00:00:00:00:1e",
"gateway_ip":"172.16.24.1"
}
],
"ovnNetworkRoutes":[
{
"dst":"172.16.29.1/24",
"gw":"172.16.24.1"
}
]
}
Pod Annotation for CNI (Internal to the plugin)
ovnIfaceList=[{"ip_address":"172.16.26.2/24", "mac_address":"0a:00:00:00:00:1d", "gateway_ip": "172.16.26.1","interface":"net0", “defaultGateway”:”true”},
{"ip_address":"172.16.24.2/24", "mac_address":"0a:00:00:00:00:1e", "gateway_ip": "172.16.24.1","interface":"net1", “defaultGateway”:”false”}]
ovnNetworkRoutes: [{ "dst": "172.16.29.1/24", "gw": “172.16.24.1” }]
{
"ovnNetwork":[
{
"name":"ovn-ls-26",
"interface":"net0",
"defaultGateway":"true"
},
{
"name":"ovn-ls-24",
"interface":"net1",
"defaultGateway":"false",
"ip_address":"172.16.24.2/24",
"mac_address":"0a:00:00:00:00:1e",
"gateway_ip":"172.16.24.1"
}
],
"ovnNetworkRoutes":[
{
"dst":"172.16.29.1/24",
"gw":"172.16.24.1"
}
]
}