2 # This yaml file contains necessary configuration to setup
3 # a demo environment for Multus + SR-IOV, the config includes
4 # the following pieces:
6 # 2. Network Plumbing Working Group Spec Version 1 CustomerResourceDefinition
7 # 3. Multus ClusterRole & ClusterRoleBinding
8 # 4. Multus & SR-IOV Device Plugin ServiceAccounts
9 # 5. Multus & SR-IOV Device Plugin & SR-IOV CNI DaemonSets
11 # Note: This yaml file will not create customer SR-IOV CRD
12 # which will be specified in Pod spec annotation. Below is
13 # an example of SR-IOV CRD:
15 # apiVersion: "k8s.cni.cncf.io/v1"
16 # kind: NetworkAttachmentDefinition
20 # k8s.v1.cni.cncf.io/resourceName: intel.com/sriov
24 # "name": "sriov-network",
26 # "type": "host-local",
27 # "subnet": "10.56.217.0/24",
31 # "gateway": "10.56.217.1"
35 # An example of Pod spec using above SR-IOV CRD:
44 # k8s.v1.cni.cncf.io/networks: sriov-net1
49 # imagePullPolicy: IfNotPresent
50 # command: [ "/bin/bash", "-c", "--" ]
51 # args: [ "while true; do sleep 300000; done;" ]
54 # intel.com/sriov: '1'
56 # intel.com/sriov: '1'
59 # --------------------------------------------------------------------
63 # This configMap assumes that:
64 # - Kubeconfig file is located at "/etc/kubernetes/admin.conf" on host
65 # - Default master plugin for Multus is set to flannel
67 # Note: If either of above is not True in your environment
68 # make sure they are properly set to the corrent values.
73 name: multus-cni-config
74 namespace: kube-system
81 "name": "multus-cni-network",
88 "cniVersion": "0.3.1",
89 "name": "default-cni-network",
92 "name": "k8s-pod-network",
93 "cniVersion": "0.3.0",
96 "datastore_type": "kubernetes",
97 "nodename": "__KUBERNETES_NODE_NAME__",
100 "type": "calico-ipam"
106 "kubeconfig": "/etc/kubernetes/admin.conf"
112 "capabilities": {"portMappings": true}
117 "kubeconfig": "/etc/kubernetes/admin.conf"
119 #"kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig"
120 # 2. NPWG spec v1 Network Attachment Definition
122 apiVersion: apiextensions.k8s.io/v1beta1
123 kind: CustomResourceDefinition
125 name: network-attachment-definitions.k8s.cni.cncf.io
127 group: k8s.cni.cncf.io
131 plural: network-attachment-definitions
132 singular: network-attachment-definition
133 kind: NetworkAttachmentDefinition
145 # 3.1 Multus Cluster Role
148 apiVersion: rbac.authorization.k8s.io/v1beta1
152 - apiGroups: ["k8s.cni.cncf.io"]
166 # 3.2 Multus Cluster Role Binding
168 kind: ClusterRoleBinding
169 apiVersion: rbac.authorization.k8s.io/v1beta1
173 apiGroup: rbac.authorization.k8s.io
177 - kind: ServiceAccount
179 namespace: kube-system
181 # 4.1 SR-IOV Device Plugin ServiceAccount
186 name: sriov-device-plugin
187 namespace: kube-system
189 # 4.2 Multus ServiceAccount
195 namespace: kube-system
197 # 5.1 SR-IOV Device Plugin DaemonSet
199 apiVersion: extensions/v1beta1
202 name: kube-sriov-device-plugin-amd64
203 namespace: kube-system
217 beta.kubernetes.io/arch: amd64
219 #- key: node-role.kubernetes.io/master
224 serviceAccountName: sriov-device-plugin
227 image: nfvpe/sriov-device-plugin
228 imagePullPolicy: IfNotPresent
232 - --resource-prefix=arm.com
237 mountPath: /var/lib/kubelet/
241 - name: config-volume
242 mountPath: /etc/pcidp
246 path: /var/lib/kubelet/
250 - name: config-volume
257 apiVersion: extensions/v1beta1
260 name: kube-sriov-device-plugin-arm64
261 namespace: kube-system
275 beta.kubernetes.io/arch: arm64
277 #- key: node-role.kubernetes.io/master
282 serviceAccountName: sriov-device-plugin
285 #image: nfvpe/sriov-device-plugin
286 image: iecedge/sriov-device-plugin-arm64
287 imagePullPolicy: IfNotPresent
288 #imagePullPolicy: Never
292 - --resource-prefix=arm.com
297 mountPath: /var/lib/kubelet/
301 - name: config-volume
302 mountPath: /etc/pcidp
306 path: /var/lib/kubelet/
310 - name: config-volume
317 # 5.2 SR-IOV CNI DaemonSet
319 apiVersion: extensions/v1beta1
322 name: kube-sriov-cni-ds-amd64
323 namespace: kube-system
336 beta.kubernetes.io/arch: amd64
338 - key: node-role.kubernetes.io/master
342 - name: kube-sriov-cni
343 image: nfvpe/sriov-cni:latest
344 imagePullPolicy: IfNotPresent
356 mountPath: /host/opt/cni/bin
362 apiVersion: extensions/v1beta1
365 name: kube-sriov-cni-ds-arm64
366 namespace: kube-system
379 beta.kubernetes.io/arch: arm64
381 #- key: node-role.kubernetes.io/master
387 - name: kube-sriov-cni
388 #image: nfvpe/sriov-cni-arm64:latest
389 image: iecedge/sriov-cni-arm64:latest
390 imagePullPolicy: IfNotPresent
402 mountPath: /host/opt/cni/bin
408 # 5.3 Multus DaemonSet
413 name: kube-multus-ds-amd64
414 namespace: kube-system
434 beta.kubernetes.io/arch: amd64
438 serviceAccountName: multus
441 #image: nfvpe/multus:v3.3
442 #- "--multus-conf-file=auto"
443 #- "--cni-version=0.3.1"
444 image: nfvpe/multus:v3.4
445 imagePullPolicy: IfNotPresent
447 - name: KUBERNETES_NODE_NAME
450 fieldPath: spec.nodeName
456 sed "s|__KUBERNETES_NODE_NAME__|${KUBERNETES_NODE_NAME}|g" /tmp/multus-conf/70-multus.conf.template > /tmp/multus-conf/70-multus.conf
458 --multus-conf-file=/tmp/multus-conf/70-multus.conf
470 mountPath: /host/etc/cni/net.d
472 mountPath: /host/opt/cni/bin
474 #mountPath: /tmp/multus-conf
477 mountPath: /tmp/multus-conf/70-multus.conf.template
478 subPath: "cni-conf.json"
479 - name: kubernetes-cfg-dir
480 mountPath: /etc/kubernetes
490 #name: multus-cni-config
492 #- key: cni-conf.json
493 # path: 70-multus.conf.template
496 name: multus-cni-config
497 - name: kubernetes-cfg-dir
499 path: /etc/kubernetes
504 name: kube-multus-ds-arm64
505 namespace: kube-system
525 beta.kubernetes.io/arch: arm64
529 serviceAccountName: multus
532 #image: nfvpe/multus:v3.3
533 #image: iecedge/multus-arm64:latest
534 #- "--multus-conf-file=auto"
535 #- "--cni-version=0.3.1"
536 image: iecedge/multus-arm64:v3.4
537 imagePullPolicy: IfNotPresent
539 - name: KUBERNETES_NODE_NAME
542 fieldPath: spec.nodeName
548 sed "s|__KUBERNETES_NODE_NAME__|${KUBERNETES_NODE_NAME}|g" /tmp/multus-conf/70-multus.conf.template > /tmp/multus-conf/70-multus.conf
550 --multus-conf-file=/tmp/multus-conf/70-multus.conf
562 mountPath: /host/etc/cni/net.d
564 mountPath: /host/opt/cni/bin
566 #mountPath: /tmp/multus-conf
569 mountPath: /tmp/multus-conf/70-multus.conf.template
570 subPath: "cni-conf.json"
571 - name: kubernetes-cfg-dir
572 mountPath: /etc/kubernetes
582 #name: multus-cni-config
584 #- key: cni-conf.json
585 # path: 70-multus.conf.template
588 name: multus-cni-config
589 - name: kubernetes-cfg-dir
591 path: /etc/kubernetes