AETHER-487 Add UPF CNI with the latest multus support
Change-Id: I6c8160817d8c429e9db2db27ad6fae07ba4e0dd7
diff --git a/omec/omec-upf-cni/.helmignore b/omec/omec-upf-cni/.helmignore
new file mode 100644
index 0000000..0d5155a
--- /dev/null
+++ b/omec/omec-upf-cni/.helmignore
@@ -0,0 +1,25 @@
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/omec/omec-upf-cni/Chart.yaml b/omec/omec-upf-cni/Chart.yaml
new file mode 100644
index 0000000..1048b63
--- /dev/null
+++ b/omec/omec-upf-cni/Chart.yaml
@@ -0,0 +1,12 @@
+---
+
+# Copyright 2019-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+description: CNI setup for OMEC data plane
+name: omec-upf-cni
+icon: https://guide.opencord.org/logos/cord.svg
+
+version: 0.1.0
diff --git a/omec/omec-upf-cni/templates/_helpers.tpl b/omec/omec-upf-cni/templates/_helpers.tpl
new file mode 100644
index 0000000..dcf8fc6
--- /dev/null
+++ b/omec/omec-upf-cni/templates/_helpers.tpl
@@ -0,0 +1,18 @@
+{{- /*
+
+# Copyright 2019-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+*/ -}}
+
+{{/*
+Renders a set of standardised labels.
+*/}}
+{{- define "omec-upf-cni.metadata_labels" -}}
+{{- $application := index . 0 -}}
+{{- $context := index . 1 -}}
+tier: node
+release: {{ $context.Release.Name }}
+app: {{ $application }}
+{{- end -}}
diff --git a/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml b/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml
new file mode 100644
index 0000000..e3e9bbd
--- /dev/null
+++ b/omec/omec-upf-cni/templates/configmap-sriov-conf.yaml
@@ -0,0 +1,43 @@
+{{/*
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: sriov-config
+data:
+ config.json: |
+ {
+ "resourceList": [
+ {
+ "resourceName": "sriov_vfio_access_net",
+ "selectors": {
+ "pfNames": {{ toJson .Values.config.sriov.resourceList.vfio.accessPfNames }},
+ "drivers": ["vfio-pci"]
+ }
+ },
+ {
+ "resourceName": "sriov_vfio_core_net",
+ "selectors": {
+ "pfNames": {{ toJson .Values.config.sriov.resourceList.vfio.corePfNames }},
+ "drivers": ["vfio-pci"]
+ }
+ }
+{{- if hasKey .Values.config.sriov.resourceList "netDevice" }}
+ ,
+ {
+ "resourceName": "sriov_netdevice",
+ "selectors": {
+ "pfNames": {{ toJson .Values.config.sriov.resourceList.netDevice.pfNames }},
+ "drivers": {{ toJson .Values.config.sriov.resourceList.netDevice.drivers }}
+ }
+ }
+{{- end }}
+ ]
+ }
diff --git a/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml b/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml
new file mode 100644
index 0000000..b9bb1cb
--- /dev/null
+++ b/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml
@@ -0,0 +1,68 @@
+{{/*
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+---
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+ name: sriov-plugin
+ labels:
+{{ tuple "sriov-plugin" . | include "omec-upf-cni.metadata_labels" | indent 4 }}
+spec:
+ selector:
+ matchLabels:
+{{ tuple "sriov-plugin" . | include "omec-upf-cni.metadata_labels" | indent 6 }}
+ template:
+ metadata:
+ labels:
+{{ tuple "sriov-plugin" . | include "omec-upf-cni.metadata_labels" | indent 8 }}
+ spec:
+ hostNetwork: true
+ hostPID: true
+ nodeSelector:
+ beta.kubernetes.io/arch: amd64
+ initContainers:
+ - name: init-sriov-plugin
+ image: {{ .Values.images.tags.omecCni }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: [ "bash", "-c" ]
+ args:
+ - cp /tmp/cni/bin/{sriov,vfioveth,jq,static} /host/opt/cni/bin/
+ volumeMounts:
+ - name: cni-bin
+ mountPath: /host/opt/cni/bin
+ containers:
+ - name: sriov-device-plugin
+ image: {{ .Values.images.tags.sriovPlugin }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: [ "/bin/sh", "-c", "--" ]
+ args: [ "sriovdp --logtostderr 10;" ]
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - mountPath: /var/lib/kubelet/
+ name: devicesock
+ readOnly: false
+ - mountPath: /sys
+ name: net
+ readOnly: true
+ - name: sriov-config
+ mountPath: /etc/pcidp
+ volumes:
+ - name: devicesock
+ hostPath:
+ path: /var/lib/kubelet/
+ - name: net
+ hostPath:
+ path: /sys
+ - name: sriov-config
+ configMap:
+ name: sriov-config
+ - name: cni-bin
+ hostPath:
+ path: /opt/cni/bin
diff --git a/omec/omec-upf-cni/values.yaml b/omec/omec-upf-cni/values.yaml
new file mode 100644
index 0000000..f9e1094
--- /dev/null
+++ b/omec/omec-upf-cni/values.yaml
@@ -0,0 +1,33 @@
+# Copyright 2019-present Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+images:
+ tags:
+ omecCni: docker.io/omecproject/omec-cni:1.0.2
+ sriovPlugin: docker.io/nfvpe/sriov-device-plugin:v3.2
+ pullPolicy: IfNotPresent
+
+config:
+ sriov:
+ # Provide interface used as a SR-IOV PF
+ # If your cluster has multiple nodes with different interface names,
+ # simply provide the whole list
+ resourceList:
+ # Provide PF name with VF range for S1U and SGI interfaces.
+ # Note that VF range of S1U must be smaller than SGI's.
+ vfio:
+ accessPfNames:
+ - eno1#0-3
+ corePfNames:
+ - eno1#4-7
+ # Provide PF name with its VFs bounded to PF's driver
+ # The driver name must be specified to prevent one interface is
+ # registered to both vfio and netdevice resource pools
+ # NOTE: netDevice is required to use CDN service
+ netDevice:
+ pfNames:
+ - eno1
+ drivers:
+ - i40evf
+ - ixgbevf