summaryrefslogtreecommitdiffstats
path: root/kud
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2019-08-14 19:41:37 +0000
committerRitu Sood <ritu.sood@intel.com>2019-08-29 06:14:02 -0700
commitb5e4a8178fce6ab9d60f1c4e2cd9ec53cbd5d2f8 (patch)
treee7fc7f5a240389ed569f5f7cfc32253ada73b34b /kud
parentdcace0784979890bb986fb078348b4b3ceef146c (diff)
Add support for Network Operator
ovn4nfvk8s plugin now uses operator sdk and controller runtime. It now includes support for Network operator. This patch includes changes needed in KUD for that. Signed-off-by: Ritu Sood <ritu.sood@intel.com> Issue-ID: MULTICLOUD-684 Change-Id: I63dc971e257067c69c70a8996eaffd1a9d8a4c2c
Diffstat (limited to 'kud')
-rw-r--r--kud/demo/firewall/charts/packetgen/templates/deployment.yaml4
-rw-r--r--kud/demo/firewall/charts/sink/templates/deployment.yaml4
-rw-r--r--kud/demo/firewall/templates/deployment.yaml4
-rw-r--r--kud/demo/firewall/templates/onap-private-net.yaml11
-rw-r--r--kud/demo/firewall/templates/protected-private-net.yaml11
-rw-r--r--kud/demo/firewall/templates/unprotected-private-net.yaml11
-rw-r--r--kud/deployment_infra/images/nfn.yml322
-rw-r--r--kud/deployment_infra/playbooks/configure-ovn4nfv.yml101
-rwxr-xr-xkud/tests/_common.sh82
-rwxr-xr-xkud/tests/integration_vcFW.sh6
-rwxr-xr-xkud/tests/ovn4nfv.sh10
11 files changed, 409 insertions, 157 deletions
diff --git a/kud/demo/firewall/charts/packetgen/templates/deployment.yaml b/kud/demo/firewall/charts/packetgen/templates/deployment.yaml
index 3538a6e7..63b10ea7 100644
--- a/kud/demo/firewall/charts/packetgen/templates/deployment.yaml
+++ b/kud/demo/firewall/charts/packetgen/templates/deployment.yaml
@@ -44,10 +44,10 @@ spec:
- wget -O - https://git.onap.org/multicloud/k8s/plain/kud/tests/vFW/packetgen | sudo -E bash
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[{"name": {{ .Values.global.ovnMultusNetworkName | quote }}, "namespace": "default"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface":[
{ "name": {{ .Values.global.unprotectedNetworkName | quote }}, "ipAddress": {{ .Values.global.vpgPrivateIp0 | quote }}, "interface": "eth1" , "defaultGateway": "false"},
{ "name": {{ .Values.global.onapPrivateNetworkName | quote }}, "ipAddress": {{ .Values.global.vpgPrivateIp1 | quote }}, "interface": "eth2" , "defaultGateway": "false"}
- ]'
+ ]}'
kubernetes.io/target-runtime: virtlet.cloud
spec:
affinity:
diff --git a/kud/demo/firewall/charts/sink/templates/deployment.yaml b/kud/demo/firewall/charts/sink/templates/deployment.yaml
index 57894010..b2119c10 100644
--- a/kud/demo/firewall/charts/sink/templates/deployment.yaml
+++ b/kud/demo/firewall/charts/sink/templates/deployment.yaml
@@ -19,10 +19,10 @@ spec:
release: {{ .Release.Name }}
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name": {{ .Values.global.ovnMultusNetworkName | quote }}, "namespace": "default"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": {{ .Values.global.protectedNetworkName | quote }}, "ipAddress": {{ .Values.global.vsnPrivateIp0 | quote }}, "interface": "eth1", "defaultGateway": "false" },
{ "name": {{ .Values.global.onapPrivateNetworkName | quote }}, "ipAddress": {{ .Values.global.vsnPrivateIp1 | quote }}, "interface": "eth2" , "defaultGateway": "false"}
- ]'
+ ]}'
spec:
containers:
- name: {{ .Chart.Name }}
diff --git a/kud/demo/firewall/templates/deployment.yaml b/kud/demo/firewall/templates/deployment.yaml
index b273d287..060f6cd2 100644
--- a/kud/demo/firewall/templates/deployment.yaml
+++ b/kud/demo/firewall/templates/deployment.yaml
@@ -42,11 +42,11 @@ spec:
- wget -O - https://git.onap.org/multicloud/k8s/plain/kud/tests/vFW/firewall | sudo -E bash
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[{"name": {{ .Values.global.ovnMultusNetworkName | quote }}, "namespace": "default"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": {{ .Values.global.unprotectedNetworkName | quote }}, "ipAddress": {{ .Values.global.vfwPrivateIp0 | quote }}, "interface": "eth1" , "defaultGateway": "false"},
{ "name": {{ .Values.global.protectedNetworkName | quote }}, "ipAddress": {{ .Values.global.vfwPrivateIp1 | quote }}, "interface": "eth2", "defaultGateway": "false" },
{ "name": {{ .Values.global.onapPrivateNetworkName | quote }}, "ipAddress": {{ .Values.global.vfwPrivateIp2 | quote }}, "interface": "eth3" , "defaultGateway": "false"}
- ]'
+ ]}'
kubernetes.io/target-runtime: virtlet.cloud
spec:
affinity:
diff --git a/kud/demo/firewall/templates/onap-private-net.yaml b/kud/demo/firewall/templates/onap-private-net.yaml
index e4079e2c..245466cf 100644
--- a/kud/demo/firewall/templates/onap-private-net.yaml
+++ b/kud/demo/firewall/templates/onap-private-net.yaml
@@ -1,9 +1,10 @@
-apiVersion: v1
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
kind: Network
metadata:
name: {{ .Values.global.onapPrivateNetworkName }}
spec:
- cnitype : ovn4nfvk8s
- name: {{ .Values.global.onapPrivateNetworkName }}
- subnet: {{ .Values.global.onapPrivateNetCidr }}
- gateway: {{ .Values.global.onapPrivateNetGw }}
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - name: subnet1
+ subnet: {{ .Values.global.onapPrivateNetCidr }}
+ gateway: {{ .Values.global.onapPrivateNetGw }}
diff --git a/kud/demo/firewall/templates/protected-private-net.yaml b/kud/demo/firewall/templates/protected-private-net.yaml
index 33724472..dcac386a 100644
--- a/kud/demo/firewall/templates/protected-private-net.yaml
+++ b/kud/demo/firewall/templates/protected-private-net.yaml
@@ -1,9 +1,10 @@
-apiVersion: v1
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
kind: Network
metadata:
name: {{ .Values.global.protectedNetworkName }}
spec:
- cnitype : ovn4nfvk8s
- name: {{ .Values.global.protectedNetworkName }}
- subnet: {{ .Values.global.protectedNetCidr }}
- gateway: {{ .Values.global.protectedNetGw }}
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - name: subnet1
+ subnet: {{ .Values.global.protectedNetCidr }}
+ gateway: {{ .Values.global.protectedNetGw }}
diff --git a/kud/demo/firewall/templates/unprotected-private-net.yaml b/kud/demo/firewall/templates/unprotected-private-net.yaml
index 2c192598..3bdc3381 100644
--- a/kud/demo/firewall/templates/unprotected-private-net.yaml
+++ b/kud/demo/firewall/templates/unprotected-private-net.yaml
@@ -1,9 +1,10 @@
-apiVersion: v1
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
kind: Network
metadata:
name: {{ .Values.global.unprotectedNetworkName }}
spec:
- cnitype : ovn4nfvk8s
- name: {{ .Values.global.unprotectedNetworkName }}
- subnet: {{ .Values.global.protectedPrivateNetCidr }}
- gateway: {{ .Values.global.protectedPrivateNetGw }}
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - name: subnet1
+ subnet: {{ .Values.global.protectedPrivateNetCidr }}
+ gateway: {{ .Values.global.protectedPrivateNetGw }}
diff --git a/kud/deployment_infra/images/nfn.yml b/kud/deployment_infra/images/nfn.yml
new file mode 100644
index 00000000..6e583b95
--- /dev/null
+++ b/kud/deployment_infra/images/nfn.yml
@@ -0,0 +1,322 @@
+
+---
+
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+ name: networks.k8s.plugin.opnfv.org
+spec:
+ group: k8s.plugin.opnfv.org
+ names:
+ kind: Network
+ listKind: NetworkList
+ plural: networks
+ singular: network
+ scope: Namespaced
+ subresources:
+ status: {}
+ validation:
+ openAPIV3Schema:
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ properties:
+ cniType:
+ description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ Important: Run "operator-sdk generate k8s" to regenerate code after
+ modifying this file Add custom validation using kubebuilder tags:
+ https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
+ type: string
+ dns:
+ properties:
+ domain:
+ type: string
+ nameservers:
+ items:
+ type: string
+ type: array
+ options:
+ items:
+ type: string
+ type: array
+ search:
+ items:
+ type: string
+ type: array
+ type: object
+ ipv4Subnets:
+ items:
+ properties:
+ excludeIps:
+ type: string
+ gateway:
+ type: string
+ name:
+ type: string
+ subnet:
+ type: string
+ required:
+ - name
+ - subnet
+ type: object
+ type: array
+ ipv6Subnets:
+ items:
+ properties:
+ excludeIps:
+ type: string
+ gateway:
+ type: string
+ name:
+ type: string
+ subnet:
+ type: string
+ required:
+ - name
+ - subnet
+ type: object
+ type: array
+ routes:
+ items:
+ properties:
+ dst:
+ type: string
+ gw:
+ type: string
+ required:
+ - dst
+ type: object
+ type: array
+ required:
+ - cniType
+ - ipv4Subnets
+ type: object
+ status:
+ properties:
+ state:
+ description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
+ of cluster Important: Run "operator-sdk generate k8s" to regenerate
+ code after modifying this file Add custom validation using kubebuilder
+ tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
+ type: string
+ required:
+ - state
+ type: object
+ version: v1alpha1
+ versions:
+ - name: v1alpha1
+ served: true
+ storage: true
+
+---
+
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: k8s-nfn-sa
+ namespace: operator
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ creationTimestamp: null
+ name: k8s-nfn-cr
+rules:
+- apiGroups:
+ - ""
+ resources:
+ - pods
+ - services
+ - endpoints
+ - persistentvolumeclaims
+ - events
+ - configmaps
+ - secrets
+ verbs:
+ - '*'
+- apiGroups:
+ - apps
+ resources:
+ - deployments
+ - daemonsets
+ - replicasets
+ - statefulsets
+ verbs:
+ - '*'
+- apiGroups:
+ - monitoring.coreos.com
+ resources:
+ - servicemonitors
+ verbs:
+ - get
+ - create
+- apiGroups:
+ - apps
+ resourceNames:
+ - nfn-operator
+ resources:
+ - deployments/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - k8s.plugin.opnfv.org
+ resources:
+ - '*'
+ - providernetworks
+ verbs:
+ - '*'
+
+---
+
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: k8s-nfn-crb
+subjects:
+- kind: Group
+ name: system:serviceaccounts
+ apiGroup: rbac.authorization.k8s.io
+roleRef:
+ kind: ClusterRole
+ name: k8s-nfn-cr
+ apiGroup: rbac.authorization.k8s.io
+
+---
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: nfn-operator
+ namespace: operator
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ name: nfn-operator
+ template:
+ metadata:
+ labels:
+ name: nfn-operator
+ spec:
+ affinity:
+ nodeAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: nfnType
+ operator: In
+ values:
+ - operator
+ tolerations:
+ - key: "node-role.kubernetes.io/master"
+ effect: "NoSchedule"
+ operator: "Exists"
+ serviceAccountName: k8s-nfn-sa
+ containers:
+ - name: nfn-operator
+ image: rtsood/nfn-operator:latest
+ command: ["/usr/local/bin/entrypoint", "operator"]
+ imagePullPolicy: IfNotPresent
+ env:
+ - name: HOST_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.hostIP
+ - name: POD_NAME
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.name
+ - name: OPERATOR_NAME
+ value: "nfn-operator"
+
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: ovn4nfv-cni-config
+ namespace: operator
+ labels:
+ app: ovn4nfv
+data:
+ ovn4nfv_k8s.conf: |
+ [logging]
+ loglevel=5
+ logfile=/var/log/openvswitch/ovn4k8s.log
+
+ [cni]
+ conf-dir=/etc/cni/net.d
+ plugin=ovn4nfvk8s-cni
+
+ [kubernetes]
+ kubeconfig=/etc/kubernetes/admin.conf
+
+---
+apiVersion: extensions/v1beta1
+kind: DaemonSet
+metadata:
+ name: ovn4nfv-cni
+ namespace: operator
+ labels:
+ app: ovn4nfv
+spec:
+ updateStrategy:
+ type: RollingUpdate
+ template:
+ metadata:
+ labels:
+ app: ovn4nfv
+ spec:
+ hostNetwork: true
+ nodeSelector:
+ beta.kubernetes.io/arch: amd64
+ tolerations:
+ - operator: Exists
+ effect: NoSchedule
+ containers:
+ - name: ovn4nfv
+ image: rtsood/nfn-operator:latest
+ command: ["/usr/local/bin/entrypoint", "cni"]
+ resources:
+ requests:
+ cpu: "100m"
+ memory: "50Mi"
+ limits:
+ cpu: "100m"
+ memory: "50Mi"
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - name: cnibin
+ mountPath: /host/opt/cni/bin
+ - name: cniconf
+ mountPath: /host/etc/openvswitch
+ - name: ovn4nfv-cfg
+ mountPath: /tmp/ovn4nfv-conf
+ volumes:
+ - name: cnibin
+ hostPath:
+ path: /opt/cni/bin
+ - name: cniconf
+ hostPath:
+ path: /etc/openvswitch
+ - name: ovn4nfv-cfg
+ configMap:
+ name: ovn4nfv-cni-config
+ items:
+ - key: ovn4nfv_k8s.conf
+ path: ovn4nfv_k8s.conf
+
+
diff --git a/kud/deployment_infra/playbooks/configure-ovn4nfv.yml b/kud/deployment_infra/playbooks/configure-ovn4nfv.yml
index 2084c95d..cff05296 100644
--- a/kud/deployment_infra/playbooks/configure-ovn4nfv.yml
+++ b/kud/deployment_infra/playbooks/configure-ovn4nfv.yml
@@ -10,95 +10,6 @@
- import_playbook: configure-ovn.yml
- import_playbook: configure-multus.yml
-- hosts: kube-master:kube-node
- environment:
- PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/"
- pre_tasks:
- - name: Load kud variables
- include_vars:
- file: kud-vars.yml
- roles:
- - role: andrewrothstein.go
- go_ver: "{{ go_version }}"
- tasks:
- - name: clone ovn4nfv-k8s-plugin repo
- git:
- repo: "{{ ovn4nfv_url }}"
- dest: "{{ ovn4nfv_dest }}"
- version: "{{ ovn4nfv_version }}"
- force: yes
- when: ovn4nfv_source_type == "source"
- - name: clean ovn4nfvk8s left over files
- make:
- chdir: "{{ ovn4nfv_dest }}"
- target: clean
- - name: build ovn4nfvk8s-cni
- make:
- chdir: "{{ ovn4nfv_dest }}"
- target: ovn4nfvk8s-cni
- become: yes
- environment:
- GOPATH: "{{ go_path }}"
- - name: copy ovn4nfvk8s-cni to cni folder
- command: "mv {{ ovn4nfv_dest }}/ovn4nfvk8s-cni /opt/cni/bin/ovn4nfvk8s-cni"
- become: yes
- - name: create ovn4k8s config file
- become: yes
- blockinfile:
- path: /etc/openvswitch/ovn4nfv_k8s.conf
- create: yes
- block: |
- [logging]
- loglevel=5
- logfile=/var/log/openvswitch/ovn4k8s.log
-
- [cni]
- conf-dir=/etc/cni/net.d
- plugin=ovn4nfvk8s-cni
-
- [kubernetes]
- kubeconfig=/etc/kubernetes/admin.conf
- - name: create ovnkube logging directory
- file:
- path: /var/log/openvswitch
- state: directory
-
-- hosts: kube-master
- environment:
- PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/"
- become: yes
- tasks:
- - name: Load kud variables
- include_vars:
- file: kud-vars.yml
- - name: build ovn4nfvk8s
- make:
- chdir: "{{ ovn4nfv_dest }}"
- target: ovn4nfvk8s
- environment:
- GOPATH: "{{ go_path }}"
- - name: copy ovn4nfvk8s to /usr/bin folder
- command: "mv {{ ovn4nfv_dest }}/ovn4nfvk8s /usr/bin/ovn4nfvk8s"
- - name: create ovn4nfvk8s systemd service
- blockinfile:
- path: /etc/systemd/system/ovn4nfvk8s.service
- create: yes
- block: |
- [Unit]
- Description=OVN4NFV Kubernetes Daemon
-
- [Service]
- ExecStart=/usr/bin/ovn4nfvk8s \
- -k8s-kubeconfig=/etc/kubernetes/admin.conf
-
- [Install]
- WantedBy=multi-user.target
- - name: start ovn4nfvk8s systemd service
- service:
- name: ovn4nfvk8s
- state: started
- enabled: yes
-
- hosts: localhost
pre_tasks:
- name: Load kud variables
@@ -124,3 +35,15 @@
- name: create network objects
shell: "/usr/local/bin/kubectl apply -f /tmp/ovn4nfvnetwork.yml"
ignore_errors: True
+
+ - name: create operator namespace
+ shell: "/usr/local/bin/kubectl create namespace operator"
+ ignore_errors: True
+
+ - name: apply nfn operator label
+ command: "/usr/local/bin/kubectl label node {{ item }} nfnType=operator --overwrite"
+ with_inventory_hostnames: ovn-central
+
+ - name: Apply NFN operator, operator roles, CRD's and ovn4nfv Daemonset
+ shell: "/usr/local/bin/kubectl apply -f ../images/nfn.yml"
+ ignore_errors: True
diff --git a/kud/tests/_common.sh b/kud/tests/_common.sh
index 044891dd..92c09b0d 100755
--- a/kud/tests/_common.sh
+++ b/kud/tests/_common.sh
@@ -277,39 +277,43 @@ spec:
MULTUS_NET
cat << NET > $unprotected_private_net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
+
metadata:
name: $unprotected_private_net
- cnitype : ovn4nfvk8s
spec:
- name: $unprotected_private_net
- subnet: $protected_private_net_cidr
- gateway: 192.168.10.1/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: $protected_private_net_cidr
+ name: subnet1
+ gateway: 192.168.10.1/24
NET
cat << NET > $protected_private_net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: $protected_private_net
- cnitype : ovn4nfvk8s
spec:
- name: $protected_private_net
- subnet: $protected_net_cidr
- gateway: $protected_net_gw/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: $protected_net_cidr
+ name: subnet1
+ gateway: $protected_net_gw/24
NET
cat << NET > $onap_private_net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: $onap_private_net
- cnitype : ovn4nfvk8s
spec:
- name: $onap_private_net
- subnet: $onap_private_net_cidr
- gateway: 10.10.0.1/16
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: $onap_private_net_cidr
+ name: subnet1
+ gateway: 10.10.0.1/16
NET
proxy="apt:"
@@ -381,10 +385,10 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": "$unprotected_private_net", "ipAddress": "$vpg_private_ip_0", "interface": "eth1" , "defaultGateway": "false"},
{ "name": "$onap_private_net", "ipAddress": "$vpg_private_ip_1", "interface": "eth2" , "defaultGateway": "false"}
- ]'
+ ]}'
kubernetes.io/target-runtime: virtlet.cloud
spec:
affinity:
@@ -449,11 +453,11 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": "$unprotected_private_net", "ipAddress": "$vfw_private_ip_0", "interface": "eth1" , "defaultGateway": "false"},
{ "name": "$protected_private_net", "ipAddress": "$vfw_private_ip_1", "interface": "eth2", "defaultGateway": "false" },
{ "name": "$onap_private_net", "ipAddress": "$vfw_private_ip_2", "interface": "eth3" , "defaultGateway": "false"}
- ]'
+ ]}'
kubernetes.io/target-runtime: virtlet.cloud
spec:
affinity:
@@ -506,10 +510,10 @@ spec:
context: darkstat
annotations:
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": "$protected_private_net", "ipAddress": "$vsn_private_ip_0", "interface": "eth1", "defaultGateway": "false" },
{ "name": "$onap_private_net", "ipAddress": "$vsn_private_ip_1", "interface": "eth2" , "defaultGateway": "false"}
- ]'
+ ]}'
spec:
containers:
- name: $sink_deployment_name
@@ -1060,27 +1064,29 @@ spec:
MULTUS_NET
cat << NETWORK > ovn-port-net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: ovn-port-net
- cnitype : ovn4nfvk8s
spec:
- name: ovn-port-net
- subnet: 172.16.33.0/24
- gateway: 172.16.33.1/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: 172.16.33.0/24
+ name: subnet1
+ gateway: 172.16.33.1/24
NETWORK
cat << NETWORK > ovn-priv-net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: ovn-priv-net
- cnitype : ovn4nfvk8s
spec:
- name: ovn-priv-net
- subnet: 172.16.44.0/24
- gateway: 172.16.44.1/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: 172.16.44.0/24
+ name: subnet1
+ gateway: 172.16.44.1/24
NETWORK
cat << DEPLOYMENT > $ovn4nfv_deployment_name.yaml
@@ -1101,8 +1107,8 @@ spec:
app: ovn4nfv
annotations:
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[{ "name": "ovn-port-net", "interface": "net0" , "defaultGateway": "false"},
- { "name": "ovn-priv-net", "interface": "net1" , "defaultGateway": "false"}]'
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [{ "name": "ovn-port-net", "interface": "net0" , "defaultGateway": "false"},
+ { "name": "ovn-priv-net", "interface": "net1" , "defaultGateway": "false"}]}'
spec:
containers:
- name: $ovn4nfv_deployment_name
diff --git a/kud/tests/integration_vcFW.sh b/kud/tests/integration_vcFW.sh
index a4035207..af8039c4 100755
--- a/kud/tests/integration_vcFW.sh
+++ b/kud/tests/integration_vcFW.sh
@@ -19,7 +19,6 @@ source _functions.sh
csar_id=aa443e7e-c8ba-11e8-8877-525400b164ff
# Setup
-install_ovn_deps
if [[ ! -f $HOME/.ssh/id_rsa.pub ]]; then
echo -e "\n\n\n" | ssh-keygen -t rsa -N ""
fi
@@ -27,9 +26,8 @@ populate_CSAR_vms_containers_vFW $csar_id
pushd ${CSAR_DIR}/${csar_id}
for net in $unprotected_private_net $protected_private_net $onap_private_net; do
- cleanup_network $net.yaml
echo "Create OVN Network $net network"
- init_network $net.yaml
+ kubectl apply -f $net.yaml
done
for resource in onap-ovn4nfvk8s-network sink-service sink_configmap; do
kubectl apply -f $resource.yaml
@@ -51,6 +49,6 @@ done
# Teardown
#teardown $packetgen_deployment_name $firewall_deployment_name $sink_deployment_name
#for net in $unprotected_private_net $protected_private_net $onap_private_net; do
-# cleanup_network $net.yaml
+# kubectl delete -f $net.yaml
#done
popd
diff --git a/kud/tests/ovn4nfv.sh b/kud/tests/ovn4nfv.sh
index 6be6aae8..cd2664ad 100755
--- a/kud/tests/ovn4nfv.sh
+++ b/kud/tests/ovn4nfv.sh
@@ -18,14 +18,12 @@ source _functions.sh
csar_id=a1c5b53e-d7ab-11e8-85b7-525400e8c29a
# Setup
-install_ovn_deps
populate_CSAR_ovn4nfv $csar_id
pushd ${CSAR_DIR}/${csar_id}
for net in ovn-priv-net ovn-port-net; do
- cleanup_network $net.yaml
echo "Create OVN Network $net network"
- init_network $net.yaml
+ kubectl apply -f $net.yaml
done
kubectl apply -f onap-ovn4nfvk8s-network.yaml
setup $ovn4nfv_deployment_name
@@ -45,6 +43,8 @@ fi
# Teardown
teardown $ovn4nfv_deployment_name
-cleanup_network ovn-priv-net.yaml
-cleanup_network ovn-port-net.yaml
+for net in ovn-priv-net ovn-port-net; do
+ echo "Delete OVN Network $net network"
+ kubectl delete -f $net.yaml
+done
popd