Skip to content

Commit

Permalink
update deployment for k8s v1.16 (#183)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ahalimx86 authored Oct 17, 2019
1 parent a66ea1d commit bf28fdc
Show file tree
Hide file tree
Showing 26 changed files with 32 additions and 469 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export GOBIN

# Docker
IMAGEDIR=$(BASE)/images
DOCKERFILE=$(CURDIR)/Dockerfile
DOCKERFILE=$(CURDIR)/images/Dockerfile
TAG=nfvpe/sriov-device-plugin
# Accept proxy settings for docker
DOCKERARGS=
Expand Down
49 changes: 19 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- [Build and run SRIOV network device plugin](#build-and-run-sriov-network-device-plugin)
- [Install one compatible CNI meta plugin](#install-one-compatible-cni-meta-plugin)
- [Option 1 - Multus](#option-1---multus)
- [Build and configure Multus](#build-and-configure-multus)
- [Install Multus](#install-multus)
- [Network Object CRDs](#network-object-crds)
- [Option 2 - DANM](#option-2---danm)
- [Install DANM](#install-danm)
Expand Down Expand Up @@ -102,41 +102,30 @@ $ cp build/sriov /opt/cni/bin
$ git clone https://github.com/intel/sriov-network-device-plugin.git
$ cd sriov-network-device-plugin
```
2. Build executable binary using `make`
2. Build docker image binary using `make`
```
$ make
```
> 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.
> 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.
3. Build docker image
3. Create a ConfigMap that defines SR-IOV resrouce pool configuration
```
$ make image
$ kubectl create -f deployments/configMap.yaml
```
4. Deploy SRIOV network device plugin Daemonset
```
$ kubectl create -f deployments/k8s-v1.16/sriovdp-daemonset.yaml
```
> For K8s version v1.15 or older use `deployments/k8s-v1.10-v1.15/sriovdp-daemonset.yaml` instead.

### Install one compatible CNI meta plugin
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.

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

##### Build and configure Multus

1. Compile Multus executable:
```
$ git clone https://github.com/intel/multus-cni.git
$ cd multus-cni
$ ./build
$ cp bin/multus /opt/cni/bin
```
2. Copy the Multus Configuration file from the Deployments folder to the CNI Configuration directory
```
$ cp deployments/cni-conf.json /etc/cni/net.d/
```

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)
```
$ kubectl create -f deployments/crdnetwork.yaml
```
##### Install Multus
Please refer to Multus [Quickstart Installation Guide](https://github.com/intel/multus-cni#quickstart-installation-guide) to install Multus.

##### Network Object CRDs

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

````
# Create ConfigMap
$ kubectl create -f images/configMap.yaml
$ kubectl create -f deployments/configMap.yaml
configmap/sriovdp-config created
# Create sriov-device-plugin-daemonset
$ kubectl create -f images/sriovdp-daemonset.yaml
daemonset.extensions/kube-sriov-device-plugin-amd64 created
$ kubectl create -f deployments/k8s-v1.16/sriovdp-daemonset.yaml
serviceaccount/sriov-device-plugin created
daemonset.apps/kube-sriov-device-plugin-amd64 created
$kubectl get pods --all-namespaces
$ kubectl -n kube-system get pods
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-sriov-device-plugin-amd64-46wpv 1/1 Running 0 4s
Expand All @@ -344,7 +334,6 @@ pod "testpod1" created
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
sriov-device-plugin 1/1 Running 0 7h
testpod1 1/1 Running 0 3s
````

Expand Down
11 changes: 0 additions & 11 deletions deployments/cni-conf.json

This file was deleted.

29 changes: 0 additions & 29 deletions deployments/config.json

This file was deleted.

File renamed without changes.
22 changes: 0 additions & 22 deletions deployments/crdnetwork.yaml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
namespace: kube-system

---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-sriov-device-plugin-amd64
Expand All @@ -15,9 +15,13 @@ metadata:
tier: node
app: sriovdp
spec:
selector:
matchLabels:
name: sriov-device-plugin
template:
metadata:
labels:
name: sriov-device-plugin
tier: node
app: sriovdp
spec:
Expand All @@ -37,7 +41,6 @@ spec:
args:
- --log-dir=sriovdp
- --log-level=10
- --resource-prefix=mellanox.com
securityContext:
privileged: true
volumeMounts:
Expand All @@ -57,7 +60,7 @@ spec:
path: /var/log
- name: config-volume
configMap:
name: sriovdp-mlnx-dpdk
name: sriovdp-config
items:
- key: config.json
path: config.json
25 changes: 0 additions & 25 deletions deployments/kernel-net-demo/config-node1.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions deployments/kernel-net-demo/config.json

This file was deleted.

21 changes: 0 additions & 21 deletions deployments/kernel-net-demo/crdnetwork.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions deployments/kernel-net-demo/pod-tc1.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions deployments/kernel-net-demo/pod-tc2.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions deployments/kernel-net-demo/pod-tc3.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions deployments/kernel-net-demo/pod-tc4.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions deployments/kernel-net-demo/pod.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions deployments/kernel-net-demo/sriov-net-a.yaml

This file was deleted.

Loading

0 comments on commit bf28fdc

Please sign in to comment.