diff options
Diffstat (limited to 'tools/k8s/reference-definitions/network-attachments/sriov')
5 files changed, 128 insertions, 0 deletions
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 |