blob: 6dbb38e6bc94360152f5c98d53ad141b1d8e702b [file] [log] [blame]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08001---
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16---
17kind: DaemonSet
18apiVersion: apps/v1
19metadata:
20 name: sriov-device-plugin
21 namespace: kube-system
22spec:
23 selector:
24 matchLabels:
25 name: sriov-device-plugin
26 template:
27 metadata:
28 labels:
29 name: sriov-device-plugin
30 spec:
Wei-Yu Chenb92af452019-01-31 12:08:19 -080031 serviceAccountName: multus-sa
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080032 initContainers:
Wei-Yu Chenb92af452019-01-31 12:08:19 -080033 - name: multus
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080034 image: ngick8stesting/aio-cni:k8s-1.13
35 command: [ "bash", "-c" ]
36 args:
37 - cp /tmp/cni/bin/{multus,sriov,centralip} /host/opt/cni/bin/;
Wei-Yu Chenb92af452019-01-31 12:08:19 -080038 /tmp/multus/install-multus-conf.sh;
39 /tmp/multus/install-certs.sh;
40 systemctl stop kubelet;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080041 echo "Restarting crio/containerd, kubelet";
42 systemctl daemon-reload;
43 systemctl restart containerd;
44 systemctl restart crio;
45 systemctl restart kubelet;
46 volumeMounts:
47 - name: usr-bin
48 mountPath: /host/usr/bin
49 - name: cni-bin
50 mountPath: /host/opt/cni/bin
Wei-Yu Chenb92af452019-01-31 12:08:19 -080051 - name: multus-sa
52 mountPath: /var/run/secrets/multus/serviceaccount
53 - name: multus-scripts
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080054 mountPath: /tmp/multus
55 - name: cni-conf
56 mountPath: /host/etc/cni/net.d
57 - name: dbus
58 mountPath: /var/run/dbus
59 - name: systemd
60 mountPath: /run/systemd
61 containers:
62 - name: sriov-device-plugin
63 image: ngick8stesting/aio-cni:k8s-1.13
64 imagePullPolicy: IfNotPresent
Wei-Yu Chenb92af452019-01-31 12:08:19 -080065 command: [ "sh", "-c" ]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080066 args:
67 - /usr/bin/sriovdp --logtostderr -v 10;
Wei-Yu Chenb92af452019-01-31 12:08:19 -080068 sleep infinity;
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080069 volumeMounts:
70 - mountPath: /var/lib/kubelet/device-plugins/
71 name: devicesock
72 readOnly: false
73 - mountPath: /sys/class/net/
74 name: net
75 readOnly: true
76 - mountPath: /etc/pcidp/
77 name: sriov-config
78 readOnly: false
79 volumes:
80 - name: sriov-config
81 configMap:
82 name: sriov-config
83 - name: usr-bin
84 hostPath:
85 path: /usr/bin
86 - name: cni-bin
87 hostPath:
88 path: /opt/cni/bin
Wei-Yu Chenb92af452019-01-31 12:08:19 -080089 - name: multus-sa
90 secret:
91 secretName: multus-sa-secret
92 - name: multus-scripts
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080093 configMap:
94 defaultMode: 511
Wei-Yu Chenb92af452019-01-31 12:08:19 -080095 name: multus-scripts
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080096 - name: cni-conf
97 hostPath:
98 path: /etc/cni/net.d
99 - name: dbus
100 hostPath:
101 path: /var/run/dbus
102 - name: systemd
103 hostPath:
104 path: /run/systemd
105 - name: net
106 hostPath:
107 path: /sys/class/net
108 - name: devicesock
109 hostPath:
110 path: /var/lib/kubelet/device-plugins/
111 hostNetwork: true
112 hostPID: true