aboutsummaryrefslogtreecommitdiffstats
path: root/tools/k8s/reference-definitions
diff options
context:
space:
mode:
authorSridhar K. N. Rao <sridhar.rao@spirent.com>2021-06-02 20:17:33 +0530
committerSridhar K. N. Rao <sridhar.rao@spirent.com>2021-06-02 20:18:55 +0530
commita5e1052beb92ac6dd45c396b753bd78986f07ab0 (patch)
tree507feb4a126a29ec7c8a001d4ed5b6ac9925b0bf /tools/k8s/reference-definitions
parent300d9f201aba1b8e30387138acaba79a72502d82 (diff)
WIP: Reference Definitions.
This patch adds reference definitions, and dockerfile for test-containers. Signed-off-by: Sridhar K. N. Rao <sridhar.rao@spirent.com> Change-Id: Ifbd90f80cb1bc91fa0bf6053fc6405891d645412
Diffstat (limited to 'tools/k8s/reference-definitions')
-rw-r--r--tools/k8s/reference-definitions/network-attachments/ovsdpdk/userspace-ovs-netAttach.yaml32
-rwxr-xr-xtools/k8s/reference-definitions/network-attachments/sriov/attach-order.sh4
-rw-r--r--tools/k8s/reference-definitions/network-attachments/sriov/configMap.yaml30
-rw-r--r--tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk-b.yaml14
-rw-r--r--tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk.yaml14
-rw-r--r--tools/k8s/reference-definitions/network-attachments/sriov/sriovdp-daemonset.yaml66
-rw-r--r--tools/k8s/reference-definitions/network-attachments/vpp/userspace-vpp-netAttach-memif.yaml32
-rw-r--r--tools/k8s/reference-definitions/pod-defs/ovsdpdk/userspace-ovs-netapp-pod.yaml47
-rw-r--r--tools/k8s/reference-definitions/pod-defs/sriov/sriov-pod.yaml47
-rw-r--r--tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod.yaml49
-rw-r--r--tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod2.yaml47
11 files changed, 382 insertions, 0 deletions
diff --git a/tools/k8s/reference-definitions/network-attachments/ovsdpdk/userspace-ovs-netAttach.yaml b/tools/k8s/reference-definitions/network-attachments/ovsdpdk/userspace-ovs-netAttach.yaml
new file mode 100644
index 00000000..b2ac5c7c
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/ovsdpdk/userspace-ovs-netAttach.yaml
@@ -0,0 +1,32 @@
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: userspace-ovs-net
+spec:
+ config: '{
+ "cniVersion": "0.3.1",
+ "type": "userspace",
+ "name": "userspace-ovs-net-1",
+ "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig",
+ "logFile": "/var/log/userspace-ovs-net.log",
+ "logLevel": "debug",
+ "host": {
+ "engine": "ovs-dpdk",
+ "iftype": "vhostuser",
+ "netType": "bridge",
+ "vhost": {
+ "mode": "server"
+ },
+ "bridge": {
+ "bridgeName": "vsperf-br0"
+ }
+ },
+ "container": {
+ "engine": "ovs-dpdk",
+ "iftype": "vhostuser",
+ "netType": "interface",
+ "vhost": {
+ "mode": "client"
+ }
+ }
+ }'
diff --git a/tools/k8s/reference-definitions/network-attachments/sriov/attach-order.sh b/tools/k8s/reference-definitions/network-attachments/sriov/attach-order.sh
new file mode 100755
index 00000000..9ffac806
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/sriov/attach-order.sh
@@ -0,0 +1,4 @@
+kubectl create -f netAttach-sriov-dpdk-a.yaml
+kubectl create -f netAttach-sriov-dpdk-b.yaml
+kubectl create -f configMap.yaml
+kubectl create -f sriovdp-daemonset.yaml
diff --git a/tools/k8s/reference-definitions/network-attachments/sriov/configMap.yaml b/tools/k8s/reference-definitions/network-attachments/sriov/configMap.yaml
new file mode 100644
index 00000000..53461c0f
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/sriov/configMap.yaml
@@ -0,0 +1,30 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: sriovdp-config
+ namespace: kube-system
+data:
+ config.json: |
+ {
+ "resourceList": [{
+ "resourceName": "intel_sriov_dpdk_a",
+ "selectors": {
+ "vendors": ["8086"],
+ "devices": ["10ed"],
+ "drivers": ["vfio-pci"],
+ "pfNames": ["eno3"]
+ }
+ },
+ {
+ "resourceName": "intel_sriov_dpdk_b",
+ "selectors": {
+ "vendors": ["8086"],
+ "devices": ["10ed"],
+ "drivers": ["vfio-pci"],
+ "pfNames": ["eno4"]
+ }
+ }
+
+ ]
+ }
+
diff --git a/tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk-b.yaml b/tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk-b.yaml
new file mode 100644
index 00000000..c876d76d
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk-b.yaml
@@ -0,0 +1,14 @@
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: sriov-net-b
+ annotations:
+ k8s.v1.cni.cncf.io/resourceName: intel.com/intel_sriov_dpdk_b
+spec:
+ config: '{
+ "type": "sriov",
+ "cniVersion": "0.3.1",
+ "name": "sriov-network-b",
+ "spoofchk": "off",
+ "trust": "on"
+}'
diff --git a/tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk.yaml b/tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk.yaml
new file mode 100644
index 00000000..9678ae4a
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/sriov/netAttach-sriov-dpdk.yaml
@@ -0,0 +1,14 @@
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: sriov-net-a
+ annotations:
+ k8s.v1.cni.cncf.io/resourceName: intel.com/intel_sriov_dpdk_a
+spec:
+ config: '{
+ "type": "sriov",
+ "cniVersion": "0.3.1",
+ "name": "sriov-network-a",
+ "spoofchk": "off",
+ "trust": "on"
+}'
diff --git a/tools/k8s/reference-definitions/network-attachments/sriov/sriovdp-daemonset.yaml b/tools/k8s/reference-definitions/network-attachments/sriov/sriovdp-daemonset.yaml
new file mode 100644
index 00000000..91a68f5b
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/sriov/sriovdp-daemonset.yaml
@@ -0,0 +1,66 @@
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: sriov-device-plugin
+ namespace: kube-system
+
+---
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+ name: kube-sriov-device-plugin-amd64
+ namespace: kube-system
+ labels:
+ tier: node
+ app: sriovdp
+spec:
+ selector:
+ matchLabels:
+ name: sriov-device-plugin
+ template:
+ metadata:
+ labels:
+ tier: node
+ app: sriovdp
+ name: sriov-device-plugin
+ spec:
+ hostNetwork: true
+ hostPID: true
+ nodeSelector:
+ beta.kubernetes.io/arch: amd64
+ tolerations:
+ - key: node-role.kubernetes.io/master
+ operator: Exists
+ effect: NoSchedule
+ serviceAccountName: sriov-device-plugin
+ containers:
+ - name: kube-sriovdp
+ image: nfvpe/sriov-device-plugin
+ imagePullPolicy: Never
+ args:
+ - --log-dir=sriovdp
+ - --log-level=10
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - name: devicesock
+ mountPath: /var/lib/kubelet/
+ readOnly: false
+ - name: log
+ mountPath: /var/log
+ - name: config-volume
+ mountPath: /etc/pcidp
+ volumes:
+ - name: devicesock
+ hostPath:
+ path: /var/lib/kubelet/
+ - name: log
+ hostPath:
+ path: /var/log
+ - name: config-volume
+ configMap:
+ name: sriovdp-config
+ items:
+ - key: config.json
+ path: config.json
diff --git a/tools/k8s/reference-definitions/network-attachments/vpp/userspace-vpp-netAttach-memif.yaml b/tools/k8s/reference-definitions/network-attachments/vpp/userspace-vpp-netAttach-memif.yaml
new file mode 100644
index 00000000..1ac6c245
--- /dev/null
+++ b/tools/k8s/reference-definitions/network-attachments/vpp/userspace-vpp-netAttach-memif.yaml
@@ -0,0 +1,32 @@
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: userspace-vpp-net
+spec:
+ config: '{
+ "cniVersion": "0.3.1",
+ "type": "userspace",
+ "name": "userspace-vpp-net",
+ "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig",
+ "logFile": "/var/log/userspace-vpp-net-1-cni.log",
+ "logLevel": "debug",
+ "host": {
+ "engine": "vpp",
+ "iftype": "memif",
+ "netType": "interface",
+ "memif": {
+ "role": "master",
+ "mode": "ethernet"
+ }
+ },
+ "container": {
+ "engine": "vpp",
+ "iftype": "memif",
+ "netType": "interface",
+ "memif": {
+ "role": "slave",
+ "mode": "ethernet"
+ }
+ }
+ }'
+
diff --git a/tools/k8s/reference-definitions/pod-defs/ovsdpdk/userspace-ovs-netapp-pod.yaml b/tools/k8s/reference-definitions/pod-defs/ovsdpdk/userspace-ovs-netapp-pod.yaml
new file mode 100644
index 00000000..64f4a5cb
--- /dev/null
+++ b/tools/k8s/reference-definitions/pod-defs/ovsdpdk/userspace-ovs-netapp-pod.yaml
@@ -0,0 +1,47 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: userspace-ovs-pod
+ annotations:
+ k8s.v1.cni.cncf.io/networks: userspace-ovs-net, userspace-ovs-net
+spec:
+ containers:
+ - name: multi-vhost
+ image: dpdk-app-centos:latest
+ imagePullPolicy: Never
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - mountPath: /etc/podnetinfo
+ name: podinfo
+ readOnly: false
+ - mountPath: /var/run/openvswitch/
+ name: shared-dir
+ - mountPath: /dev/hugepages
+ name: hugepage
+ resources:
+ requests:
+ cpu: "4000m"
+ hugepages-1Gi: 4Gi
+ limits:
+ cpu: "4000m"
+ hugepages-1Gi: 4Gi
+ command: ["sleep", "infinity"]
+ nodeSelector:
+ vswitch: ovs
+ volumes:
+ - name: podinfo
+ downwardAPI:
+ items:
+ - path: "labels"
+ fieldRef:
+ fieldPath: metadata.labels
+ - path: "annotations"
+ fieldRef:
+ fieldPath: metadata.annotations
+ - name: shared-dir
+ hostPath:
+ path: /usr/local/var/run/openvswitch/
+ - name: hugepage
+ emptyDir:
+ medium: HugePages
diff --git a/tools/k8s/reference-definitions/pod-defs/sriov/sriov-pod.yaml b/tools/k8s/reference-definitions/pod-defs/sriov/sriov-pod.yaml
new file mode 100644
index 00000000..2b5aff7a
--- /dev/null
+++ b/tools/k8s/reference-definitions/pod-defs/sriov/sriov-pod.yaml
@@ -0,0 +1,47 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: sriov-pod
+ annotations:
+ k8s.v1.cni.cncf.io/networks: sriov-net-a, sriov-net-b
+spec:
+ containers:
+ - name: sriov
+ image: dpdk-app-centos-numa1
+ imagePullPolicy: Never
+ securityContext:
+ privileged: true
+ capabilities:
+ add: ["CAP_SYS_ADMIN"]
+ volumeMounts:
+ - mountPath: /etc/podnetinfo
+ name: podnetinfo
+ readOnly: false
+ - mountPath: /dev/hugepages
+ name: hugepage
+ resources:
+ requests:
+ cpu: "6000m"
+ intel.com/intel_sriov_dpdk_a: '1'
+ intel.com/intel_sriov_dpdk_b: '1'
+ limits:
+ cpu: "6000m"
+ hugepages-1Gi: 2Gi
+ intel.com/intel_sriov_dpdk_a: '1'
+ intel.com/intel_sriov_dpdk_b: '1'
+ command: ["sleep", "infinity"]
+# nodeSelector:
+# vswitch: ovs
+ volumes:
+ - name: podnetinfo
+ downwardAPI:
+ items:
+ - path: "labels"
+ fieldRef:
+ fieldPath: metadata.labels
+ - path: "annotations"
+ fieldRef:
+ fieldPath: metadata.annotations
+ - name: hugepage
+ emptyDir:
+ medium: HugePages
diff --git a/tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod.yaml b/tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod.yaml
new file mode 100644
index 00000000..4b72df22
--- /dev/null
+++ b/tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod.yaml
@@ -0,0 +1,49 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: userspace-vpp-pod
+ annotations:
+ k8s.v1.cni.cncf.io/networks: userspace-vpp-net, userspace-vpp-net
+spec:
+ containers:
+ - name: vpp-vhost
+ image: newdpdk-app-centos:latest
+ imagePullPolicy: Never
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - mountPath: /etc/podnetinfo
+ name: podinfo
+ readOnly: false
+ - mountPath: /var/lib/cni/usrspcni/
+ name: shared-dir
+ - mountPath: /dev/hugepages
+ name: hugepage
+ resources:
+ requests:
+ cpu: "6000m"
+ memory: "4000Mi"
+ hugepages-1Gi: 4Gi
+ limits:
+ cpu: "6000m"
+ memory: "4000Mi"
+ hugepages-1Gi: 4Gi
+ command: ["sleep", "infinity"]
+ nodeSelector:
+ vswitch: ovs
+ volumes:
+ - name: podinfo
+ downwardAPI:
+ items:
+ - path: "labels"
+ fieldRef:
+ fieldPath: metadata.labels
+ - path: "annotations"
+ fieldRef:
+ fieldPath: metadata.annotations
+ - name: shared-dir
+ hostPath:
+ path: /var/lib/cni/usrspcni/data/
+ - name: hugepage
+ emptyDir:
+ medium: HugePages
diff --git a/tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod2.yaml b/tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod2.yaml
new file mode 100644
index 00000000..7e3d2e71
--- /dev/null
+++ b/tools/k8s/reference-definitions/pod-defs/vpp/userspace-dpdk-pod2.yaml
@@ -0,0 +1,47 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: userspace-vpp-pod2
+ annotations:
+ k8s.v1.cni.cncf.io/networks: userspace-vpp-net, userspace-vpp-net
+spec:
+ containers:
+ - name: vpp-vhost
+ image: newdpdk-app-centos:latest
+ imagePullPolicy: Never
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - mountPath: /etc/podnetinfo
+ name: podinfo
+ readOnly: false
+ - mountPath: /var/lib/cni/usrspcni/
+ name: shared-dir
+ - mountPath: /dev/hugepages
+ name: hugepage
+ resources:
+ requests:
+ cpu: "6000m"
+ hugepages-1Gi: 4Gi
+ limits:
+ cpu: "6000m"
+ hugepages-1Gi: 4Gi
+ command: ["sleep", "infinity"]
+ nodeSelector:
+ vswitch: ovs
+ volumes:
+ - name: podinfo
+ downwardAPI:
+ items:
+ - path: "labels"
+ fieldRef:
+ fieldPath: metadata.labels
+ - path: "annotations"
+ fieldRef:
+ fieldPath: metadata.annotations
+ - name: shared-dir
+ hostPath:
+ path: /var/lib/cni/usrspcni/data/
+ - name: hugepage
+ emptyDir:
+ medium: HugePages