Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 1525407

Browse files
authored
Update multi-net components to latest releases (#329)
* Update multi-net components to latest releases Multus CNI 3.4.2 SR-IOV CNI 2.3 SR-IOV DP 3.2 Tested as per the README. Works fine. Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com> * Provide dpdk-stable 3 LTS and 1 recent release Testpmd manifests of the last 3 LTS and 1 latest release from stable repo to help test actual DPDK app instead of sleep. Currently 17.11 and 19.11 are the only functioning ones without privileged. ``` NAME READY STATUS RESTARTS AGE dpdk-1711 1/1 Running 0 3m5s dpdk-1811 0/1 Error 0 3m5s dpdk-1911 1/1 Running 0 3m5s dpdk-2002 0/1 Error 0 3m5s ``` ``` EAL: PCI device 0000:07:06.4 on NUMA socket 0 EAL: probe driver: 8086:154c net_i40e_vf EAL: Getting a vfio_dev_fd for 0000:07:06.4 failed EAL: Requested device 0000:07:06.4 cannot be used … testpmd: No probed ethernet devices EAL: Error - exiting with code: 1 Cause: Invalid port 1 ``` Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
1 parent 9b4f0a8 commit 1525407

6 files changed

Lines changed: 210 additions & 64 deletions

File tree

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
# Build multus plugin
2-
FROM golang:1.10 AS multus
3-
RUN git clone -q --depth 1 https://github.com/intel/multus-cni.git /go/src/github.com/intel/multus-cni
4-
WORKDIR /go/src/github.com/intel/multus-cni
5-
RUN ./build
2+
FROM busybox AS multus
3+
ARG MULTUS_VER=3.4.2
4+
RUN wget -O multus.tgz https://github.com/intel/multus-cni/releases/download/v${MULTUS_VER}/multus-cni_${MULTUS_VER}_linux_amd64.tar.gz
5+
RUN tar xvzf multus.tgz --strip-components=1 -C /bin
66

77
# Build sriov plugin
8-
FROM golang:1.10 AS sriov-cni
9-
RUN git clone -q -b dev/k8s-deviceid-model https://github.com/Intel-Corp/sriov-cni.git /go/src/github.com/intel-corp/sriov-cni
10-
WORKDIR /go/src/github.com/intel-corp/sriov-cni
11-
RUN ./build
8+
FROM golang AS sriov-cni
9+
ARG SRIOV_CNI_VER=2.3
10+
RUN wget -qO sriov-cni.tgz https://github.com/intel/sriov-cni/archive/v${SRIOV_CNI_VER}.tar.gz
11+
RUN mkdir -p sriov-cni && \
12+
tar xzf sriov-cni.tgz --strip-components=1 -C sriov-cni && \
13+
cd sriov-cni && \
14+
make && \
15+
cp build/sriov /bin
1216

1317
# Build sriov device plugin
14-
FROM golang:1.10 AS sriov-dp
15-
RUN git clone -q https://github.com/intel/sriov-network-device-plugin.git /go/src/github.com/intel/sriov-network-device-plugin
16-
WORKDIR /go/src/github.com/intel/sriov-network-device-plugin
17-
RUN make
18+
FROM golang AS sriov-dp
19+
ARG SRIOV_DP_VER=3.2
20+
RUN wget -qO sriov-dp.tgz https://github.com/intel/sriov-network-device-plugin/archive/v${SRIOV_DP_VER}.tar.gz
21+
RUN mkdir -p sriov-dp && \
22+
tar xzf sriov-dp.tgz --strip-components=1 -C sriov-dp && \
23+
cd sriov-dp && \
24+
make && \
25+
cp build/sriovdp /bin
1826

1927
# Build vfioveth plugin
2028
FROM busybox as vfioveth
@@ -25,9 +33,9 @@ RUN chmod +x /bin/vfioveth /bin/jq
2533
# Final image
2634
FROM centos/systemd
2735
WORKDIR /tmp/cni/bin
28-
COPY --from=multus /go/src/github.com/intel/multus-cni/bin/multus .
29-
COPY --from=sriov-cni /go/src/github.com/intel-corp/sriov-cni/bin/sriov .
36+
COPY --from=multus /bin/multus-cni .
37+
COPY --from=sriov-cni /bin/sriov .
3038
COPY --from=vfioveth /bin/vfioveth .
3139
COPY --from=vfioveth /bin/jq .
3240
WORKDIR /usr/bin
33-
COPY --from=sriov-dp /go/src/github.com/intel/sriov-network-device-plugin/build/sriovdp .
41+
COPY --from=sriov-dp /bin/sriovdp .

clr-k8s-examples/9-multi-network/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ directories on the host with the necessary binaries and configuration files.
99
1010
### Customization
1111

12-
The device plugin will register the SR-IOV enabled devices on the host, specified as
13-
`rootDevices` in [sriov-conf.yaml](sriov-conf.yaml). Helper [systemd unit](systemd/sriov.service)
14-
file is provided, which enables SR-IOV for the above `rootDevices`
15-
16-
> NOTE: This assumes homogenous nodes in the cluster
12+
The device plugin will register the SR-IOV enabled devices on the host, specified with
13+
`selectors` in [sriov-conf.yaml](sriov-conf.yaml). Helper [systemd unit](systemd/sriov.service)
14+
file is provided, which enables SR-IOV for the above devices. More config options
15+
are listed [here](https://github.com/intel/sriov-network-device-plugin#configurations).
1716

1817
### Pre-req (SR-IOV only)
1918

clr-k8s-examples/9-multi-network/multus-sriov-ds.yaml

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,34 @@
22
apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
5-
# name must match the spec fields below, and be in the form: <plural>.<group>
65
name: network-attachment-definitions.k8s.cni.cncf.io
76
spec:
8-
# group name to use for REST API: /apis/<group>/<version>
97
group: k8s.cni.cncf.io
10-
# version name to use for REST API: /apis/<group>/<version>
11-
version: v1
12-
# either Namespaced or Cluster
138
scope: Namespaced
149
names:
15-
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
1610
plural: network-attachment-definitions
17-
# singular name to be used as an alias on the CLI and for display
1811
singular: network-attachment-definition
19-
# kind is normally the CamelCased singular type. Your resource manifests use this.
2012
kind: NetworkAttachmentDefinition
21-
# shortNames allow shorter string to match your resource on the CLI
2213
shortNames:
2314
- net-attach-def
15+
versions:
16+
- name: v1
17+
served: true
18+
storage: true
19+
schema:
20+
openAPIV3Schema:
21+
description: 'NetworkAttachmentDefinition is a CRD schema specified by the Network Plumbing
22+
Working Group to express the intent for attaching pods to one or more logical or physical
23+
networks. More information available at: https://github.com/k8snetworkplumbingwg/multi-net-spec'
24+
type: object
25+
properties:
26+
spec:
27+
description: 'NetworkAttachmentDefinition spec defines the desired state of a network attachment'
28+
type: object
29+
properties:
30+
config:
31+
description: 'NetworkAttachmentDefinition config is a JSON-formatted CNI configuration'
32+
type: string
2433
---
2534
apiVersion: v1
2635
kind: ServiceAccount
@@ -40,17 +49,43 @@ type: kubernetes.io/service-account-token
4049
kind: ClusterRole
4150
apiVersion: rbac.authorization.k8s.io/v1
4251
metadata:
43-
name: multus-pod-networks-lister
52+
name: multus-pod-updater
4453
rules:
45-
- apiGroups: [""]
46-
resources: ["pods"]
47-
verbs: ["get"]
48-
- apiGroups: [""]
49-
resources: ["pods/status"]
50-
verbs: ["update"]
51-
- apiGroups: ["k8s.cni.cncf.io"]
52-
resources: ["*"]
53-
verbs: ["get"]
54+
- apiGroups: ["k8s.cni.cncf.io"]
55+
resources:
56+
- '*'
57+
verbs:
58+
- '*'
59+
- apiGroups:
60+
- ""
61+
resources:
62+
- pods
63+
- pods/status
64+
verbs:
65+
- get
66+
- update
67+
- apiGroups:
68+
- ""
69+
- events.k8s.io
70+
resources:
71+
- events
72+
verbs:
73+
- create
74+
- patch
75+
- update
76+
---
77+
kind: ClusterRoleBinding
78+
apiVersion: rbac.authorization.k8s.io/v1
79+
metadata:
80+
name: multus-rb
81+
roleRef:
82+
apiGroup: rbac.authorization.k8s.io
83+
kind: ClusterRole
84+
name: multus-pod-updater
85+
subjects:
86+
- kind: ServiceAccount
87+
name: multus-sa
88+
namespace: kube-system
5489
---
5590
kind: ConfigMap
5691
apiVersion: v1
@@ -94,8 +129,9 @@ data:
94129
MASTER_PLUGIN_JSON="$(cat /host/etc/cni/net.d/$MASTER_PLUGIN)"
95130
cat > /host/etc/cni/net.d/00-multus.conf <<EOF
96131
{
132+
"cniVersion": "0.3.1",
97133
"name": "multus-cni-network",
98-
"type": "multus",
134+
"type": "multus-cni",
99135
"logFile": "/var/log/multus.log",
100136
"logLevel": "debug",
101137
"kubeconfig": "/etc/cni/net.d/multus-kubeconfig",
@@ -105,19 +141,6 @@ data:
105141
}
106142
EOF
107143
---
108-
kind: ClusterRoleBinding
109-
apiVersion: rbac.authorization.k8s.io/v1
110-
metadata:
111-
name: multus-rb
112-
roleRef:
113-
apiGroup: rbac.authorization.k8s.io
114-
kind: ClusterRole
115-
name: multus-pod-networks-lister
116-
subjects:
117-
- kind: ServiceAccount
118-
name: multus-sa
119-
namespace: kube-system
120-
---
121144
apiVersion: apps/v1
122145
kind: DaemonSet
123146
metadata:
@@ -134,14 +157,14 @@ spec:
134157
spec:
135158
initContainers:
136159
- name: multus
137-
image: krsna1729/multus-sriov:k8s-1.13
160+
image: krsna1729/multus-sriov:3.4.2-2.3-3.2
138161
command: [ "bash", "-c" ]
139162
args:
140-
- cp /tmp/cni/bin/{multus,sriov,vfioveth,jq} /host/opt/cni/bin/;
163+
- cp /tmp/cni/bin/{multus-cni,sriov,vfioveth,jq} /host/opt/cni/bin/;
141164
/tmp/multus/install-multus-conf.sh;
142165
/tmp/multus/install-certs.sh;
143166
echo "Restarting crio kubelet";
144-
systemctl restart crio; # Needed when crio manages ns lifecycle
167+
systemctl restart crio;
145168
systemctl restart kubelet;
146169
volumeMounts:
147170
- name: usr-bin
@@ -160,7 +183,7 @@ spec:
160183
mountPath: /run/systemd
161184
containers:
162185
- name: sriovdp
163-
image: krsna1729/multus-sriov:k8s-1.13
186+
image: krsna1729/multus-sriov:3.4.2-2.3-3.2
164187
command: [ "sh", "-c" ]
165188
args:
166189
- /usr/bin/sriovdp --logtostderr -v 10;
@@ -209,4 +232,3 @@ spec:
209232
path: /var/lib/kubelet/device-plugins/
210233
hostNetwork: true
211234
hostPID: true
212-

clr-k8s-examples/9-multi-network/sriov-conf.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ data:
1111
[
1212
{
1313
"resourceName": "sriov_netdevice",
14-
"rootDevices": ["07:00.0"],
15-
"sriovMode": true,
16-
"deviceType": "netdevice"
14+
"selectors": {
15+
"drivers": ["i40evf", "iavf"]
16+
}
1717
},
1818
{
1919
"resourceName": "sriov_vfio",
20-
"rootDevices": ["07:00.1"],
21-
"sriovMode": true,
22-
"deviceType": "vfio"
20+
"selectors": {
21+
"drivers": ["vfio-pci"]
22+
}
2323
}
2424
]
2525
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
apiVersion: v1
3+
kind: Pod
4+
metadata:
5+
name: dpdk-1711
6+
annotations:
7+
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
8+
spec:
9+
restartPolicy: Never
10+
containers:
11+
- name: dpdk
12+
image: krsna1729/dpdk:17.11
13+
stdin: true
14+
tty: true
15+
command: [ "/bin/bash", "-c"]
16+
args:
17+
- ls -l /dev/vfio;
18+
testpmd --no-huge -m 2048 -- --stats-period=10 --nb-port=1 --port-topology=chained --auto-start --total-num-mbufs=2048 --forward-mode=macswap;
19+
securityContext:
20+
capabilities:
21+
add:
22+
- IPC_LOCK
23+
resources:
24+
limits:
25+
intel.com/sriov_vfio: '1'
26+
---
27+
apiVersion: v1
28+
kind: Pod
29+
metadata:
30+
name: dpdk-1811
31+
annotations:
32+
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
33+
spec:
34+
restartPolicy: Never
35+
containers:
36+
- name: dpdk
37+
image: krsna1729/dpdk:18.11
38+
stdin: true
39+
tty: true
40+
command: [ "/bin/bash", "-c"]
41+
args:
42+
- ls -l /dev/vfio;
43+
testpmd --no-huge -m 2048 -- --stats-period=10 --nb-port=1 --port-topology=chained --auto-start --total-num-mbufs=2048 --forward-mode=macswap;
44+
securityContext:
45+
capabilities:
46+
add:
47+
- IPC_LOCK
48+
resources:
49+
limits:
50+
intel.com/sriov_vfio: '1'
51+
---
52+
apiVersion: v1
53+
kind: Pod
54+
metadata:
55+
name: dpdk-1911
56+
annotations:
57+
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
58+
spec:
59+
restartPolicy: Never
60+
containers:
61+
- name: dpdk
62+
image: krsna1729/dpdk:19.11
63+
stdin: true
64+
tty: true
65+
command: [ "/bin/bash", "-c"]
66+
args:
67+
- ls -l /dev/vfio;
68+
testpmd --no-huge -m 2048 -- --stats-period=10 --nb-port=1 --port-topology=chained --auto-start --total-num-mbufs=2048 --forward-mode=macswap;
69+
securityContext:
70+
capabilities:
71+
add:
72+
- IPC_LOCK
73+
resources:
74+
limits:
75+
intel.com/sriov_vfio: '1'
76+
---
77+
apiVersion: v1
78+
kind: Pod
79+
metadata:
80+
name: dpdk-2002
81+
annotations:
82+
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
83+
spec:
84+
restartPolicy: Never
85+
containers:
86+
- name: dpdk
87+
image: krsna1729/dpdk:20.02
88+
stdin: true
89+
tty: true
90+
command: [ "/bin/bash", "-c"]
91+
args:
92+
- ls -l /dev/vfio;
93+
testpmd --no-huge -m 2048 -- --stats-period=10 --nb-port=1 --port-topology=chained --auto-start --total-num-mbufs=2048 --forward-mode=macswap;
94+
securityContext:
95+
capabilities:
96+
add:
97+
- IPC_LOCK
98+
resources:
99+
limits:
100+
intel.com/sriov_vfio: '1'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:bionic as ubuntu-build
2+
RUN apt-get update && \
3+
apt-get -y install \
4+
build-essential \
5+
git \
6+
libnuma-dev
7+
8+
ARG DPDK_VER='master'
9+
ENV DPDK_DIR='/dpdk'
10+
ENV RTE_TARGET='x86_64-native-linuxapp-gcc'
11+
RUN git clone -b $DPDK_VER -q --depth 1 http://dpdk.org/git/dpdk-stable $DPDK_DIR 2>&1
12+
RUN cd ${DPDK_DIR} && \
13+
sed -ri 's,(IGB_UIO=).*,\1n,' config/common_linux* && \
14+
sed -ri 's,(KNI_KMOD=).*,\1n,' config/common_linux* && \
15+
make config T=x86_64-native-linuxapp-gcc && \
16+
make -j $CPUS
17+
ENV PATH="$PATH:$DPDK_DIR/build/app/"

0 commit comments

Comments
 (0)