Skip to content

Commit bf28fdc

Browse files
authored
update deployment for k8s v1.16 (k8snetworkplumbingwg#183)
- New daemonset to support k8s v1.16 - Moved daemonsets into K8s versions specific dir - Removed redundant/not-used sample deployments - Moved Dockerfile into image/ - Removed additional daemonset yaml from docs/dpdk and docs/rdma
1 parent a66ea1d commit bf28fdc

26 files changed

+32
-469
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export GOBIN
2020

2121
# Docker
2222
IMAGEDIR=$(BASE)/images
23-
DOCKERFILE=$(CURDIR)/Dockerfile
23+
DOCKERFILE=$(CURDIR)/images/Dockerfile
2424
TAG=nfvpe/sriov-device-plugin
2525
# Accept proxy settings for docker
2626
DOCKERARGS=

README.md

+19-30
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- [Build and run SRIOV network device plugin](#build-and-run-sriov-network-device-plugin)
1414
- [Install one compatible CNI meta plugin](#install-one-compatible-cni-meta-plugin)
1515
- [Option 1 - Multus](#option-1---multus)
16-
- [Build and configure Multus](#build-and-configure-multus)
16+
- [Install Multus](#install-multus)
1717
- [Network Object CRDs](#network-object-crds)
1818
- [Option 2 - DANM](#option-2---danm)
1919
- [Install DANM](#install-danm)
@@ -102,41 +102,30 @@ $ cp build/sriov /opt/cni/bin
102102
$ git clone https://github.com/intel/sriov-network-device-plugin.git
103103
$ cd sriov-network-device-plugin
104104
```
105-
2. Build executable binary using `make`
105+
2. Build docker image binary using `make`
106106
```
107107
$ make
108108
```
109-
> On successful build the `sriovdp` executable can be found in `./build` directory. It is recommended to run the plugin in a container or K8s Pod. The follow on steps cover how to build and run the Docker image of the plugin.
109+
> On a successful build, a docker image with tag `nfvpe/sriov-device-plugin:latest` will be created. You will need to build this image on each node. Alternatively, you could use a local docker registry to host this image.
110110
111-
3. Build docker image
111+
3. Create a ConfigMap that defines SR-IOV resrouce pool configuration
112112
```
113-
$ make image
113+
$ kubectl create -f deployments/configMap.yaml
114114
```
115+
4. Deploy SRIOV network device plugin Daemonset
116+
```
117+
$ kubectl create -f deployments/k8s-v1.16/sriovdp-daemonset.yaml
118+
```
119+
> For K8s version v1.15 or older use `deployments/k8s-v1.10-v1.15/sriovdp-daemonset.yaml` instead.
120+
115121

116122
### Install one compatible CNI meta plugin
123+
A compatible CNI meta-plugin installation is required for SR-IOV CNI plugin to be able to get allocated VF's deviceID in order to configure it.
117124

118125
#### Option 1 - Multus
119-
This section explains an example deployment of SRIOV Network device plugin in Kubernetes if you choose Multus as your meta plugin.
120-
Required YAML files can be found in [deployments/](deployments/) directory.
121126

122-
##### Build and configure Multus
123-
124-
1. Compile Multus executable:
125-
```
126-
$ git clone https://github.com/intel/multus-cni.git
127-
$ cd multus-cni
128-
$ ./build
129-
$ cp bin/multus /opt/cni/bin
130-
```
131-
2. Copy the Multus Configuration file from the Deployments folder to the CNI Configuration directory
132-
```
133-
$ cp deployments/cni-conf.json /etc/cni/net.d/
134-
```
135-
136-
3. Configure Kubernetes network CRD with [Multus](https://github.com/intel/multus-cni/tree/dev/network-plumbing-working-group-crd-change#creating-network-resources-in-kubernetes)
137-
```
138-
$ kubectl create -f deployments/crdnetwork.yaml
139-
```
127+
##### Install Multus
128+
Please refer to Multus [Quickstart Installation Guide](https://github.com/intel/multus-cni#quickstart-installation-guide) to install Multus.
140129

141130
##### Network Object CRDs
142131

@@ -318,14 +307,15 @@ The [images](./images) directory contains example Dockerfile, sample specs along
318307

319308
````
320309
# Create ConfigMap
321-
$ kubectl create -f images/configMap.yaml
310+
$ kubectl create -f deployments/configMap.yaml
322311
configmap/sriovdp-config created
323312
324313
# Create sriov-device-plugin-daemonset
325-
$ kubectl create -f images/sriovdp-daemonset.yaml
326-
daemonset.extensions/kube-sriov-device-plugin-amd64 created
314+
$ kubectl create -f deployments/k8s-v1.16/sriovdp-daemonset.yaml
315+
serviceaccount/sriov-device-plugin created
316+
daemonset.apps/kube-sriov-device-plugin-amd64 created
327317
328-
$kubectl get pods --all-namespaces
318+
$ kubectl -n kube-system get pods
329319
NAMESPACE NAME READY STATUS RESTARTS AGE
330320
kube-system kube-sriov-device-plugin-amd64-46wpv 1/1 Running 0 4s
331321
@@ -344,7 +334,6 @@ pod "testpod1" created
344334
345335
$ kubectl get pods
346336
NAME READY STATUS RESTARTS AGE
347-
sriov-device-plugin 1/1 Running 0 7h
348337
testpod1 1/1 Running 0 3s
349338
````
350339

deployments/cni-conf.json

-11
This file was deleted.

deployments/config.json

-29
This file was deleted.
File renamed without changes.

deployments/crdnetwork.yaml

-22
This file was deleted.

docs/dpdk/mlnx-dpdk/sriovdp-daemonset.yaml deployments/k8s-v1.16/sriovdp-daemonset.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
namespace: kube-system
77

88
---
9-
apiVersion: extensions/v1beta1
9+
apiVersion: apps/v1
1010
kind: DaemonSet
1111
metadata:
1212
name: kube-sriov-device-plugin-amd64
@@ -15,9 +15,13 @@ metadata:
1515
tier: node
1616
app: sriovdp
1717
spec:
18+
selector:
19+
matchLabels:
20+
name: sriov-device-plugin
1821
template:
1922
metadata:
2023
labels:
24+
name: sriov-device-plugin
2125
tier: node
2226
app: sriovdp
2327
spec:
@@ -37,7 +41,6 @@ spec:
3741
args:
3842
- --log-dir=sriovdp
3943
- --log-level=10
40-
- --resource-prefix=mellanox.com
4144
securityContext:
4245
privileged: true
4346
volumeMounts:
@@ -57,7 +60,7 @@ spec:
5760
path: /var/log
5861
- name: config-volume
5962
configMap:
60-
name: sriovdp-mlnx-dpdk
63+
name: sriovdp-config
6164
items:
6265
- key: config.json
6366
path: config.json

deployments/kernel-net-demo/config-node1.yaml

-25
This file was deleted.

deployments/kernel-net-demo/config.json

-17
This file was deleted.

deployments/kernel-net-demo/crdnetwork.yaml

-21
This file was deleted.

deployments/kernel-net-demo/pod-tc1.yaml

-21
This file was deleted.

deployments/kernel-net-demo/pod-tc2.yaml

-20
This file was deleted.

deployments/kernel-net-demo/pod-tc3.yaml

-20
This file was deleted.

deployments/kernel-net-demo/pod-tc4.yaml

-20
This file was deleted.

deployments/kernel-net-demo/pod.yaml

-14
This file was deleted.

deployments/kernel-net-demo/sriov-net-a.yaml

-21
This file was deleted.

0 commit comments

Comments
 (0)