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/v1
123 kind: CustomResourceDefinition
125 name: network-attachment-definitions.k8s.cni.cncf.io
127 group: k8s.cni.cncf.io
130 plural: network-attachment-definitions
131 singular: network-attachment-definition
132 kind: NetworkAttachmentDefinition
148 # 3.1 Multus Cluster Role
151 apiVersion: rbac.authorization.k8s.io/v1beta1
155 - apiGroups: ["k8s.cni.cncf.io"]
169 # 3.2 Multus Cluster Role Binding
171 kind: ClusterRoleBinding
172 apiVersion: rbac.authorization.k8s.io/v1beta1
176 apiGroup: rbac.authorization.k8s.io
180 - kind: ServiceAccount
182 namespace: kube-system
184 # 4.1 SR-IOV Device Plugin ServiceAccount
189 name: sriov-device-plugin
190 namespace: kube-system
192 # 4.2 Multus ServiceAccount
198 namespace: kube-system
200 # 5.1 SR-IOV Device Plugin DaemonSet
205 name: kube-sriov-device-plugin-amd64
206 namespace: kube-system
213 name: sriov-device-plugin
217 name: sriov-device-plugin
224 beta.kubernetes.io/arch: amd64
226 #- key: node-role.kubernetes.io/master
231 serviceAccountName: sriov-device-plugin
234 #image: nfvpe/sriov-device-plugin
235 image: iecedge/sriov-device-plugin-amd64
236 imagePullPolicy: IfNotPresent
240 - --resource-prefix=arm.com
245 mountPath: /var/lib/kubelet/
249 - name: config-volume
250 mountPath: /etc/pcidp
254 path: /var/lib/kubelet/
258 - name: config-volume
268 name: kube-sriov-device-plugin-arm64
269 namespace: kube-system
276 name: sriov-device-plugin
280 name: sriov-device-plugin
287 beta.kubernetes.io/arch: arm64
289 #- key: node-role.kubernetes.io/master
294 serviceAccountName: sriov-device-plugin
297 #image: nfvpe/sriov-device-plugin
298 image: iecedge/sriov-device-plugin-arm64
299 imagePullPolicy: IfNotPresent
300 #imagePullPolicy: Never
304 - --resource-prefix=arm.com
309 mountPath: /var/lib/kubelet/
313 - name: config-volume
314 mountPath: /etc/pcidp
318 path: /var/lib/kubelet/
322 - name: config-volume
329 # 5.2 SR-IOV CNI DaemonSet
334 name: kube-sriov-cni-ds-amd64
335 namespace: kube-system
352 beta.kubernetes.io/arch: amd64
354 - key: node-role.kubernetes.io/master
358 - name: kube-sriov-cni
359 #image: nfvpe/sriov-cni:latest
360 image: iecedge/sriov-cni-amd64:latest
361 imagePullPolicy: IfNotPresent
373 mountPath: /host/opt/cni/bin
382 name: kube-sriov-cni-ds-arm64
383 namespace: kube-system
400 beta.kubernetes.io/arch: arm64
402 #- key: node-role.kubernetes.io/master
408 - name: kube-sriov-cni
409 #image: nfvpe/sriov-cni-arm64:latest
410 image: iecedge/sriov-cni-arm64:latest
411 imagePullPolicy: IfNotPresent
423 mountPath: /host/opt/cni/bin
429 # 5.3 Multus DaemonSet
434 name: kube-multus-ds-amd64
435 namespace: kube-system
455 beta.kubernetes.io/arch: amd64
459 serviceAccountName: multus
462 #image: nfvpe/multus:v3.3
463 #- "--multus-conf-file=auto"
464 #- "--cni-version=0.3.1"
465 #image: nfvpe/multus:v3.4
466 image: iecedge/multus-amd64:v3.4
467 imagePullPolicy: IfNotPresent
469 - name: KUBERNETES_NODE_NAME
472 fieldPath: spec.nodeName
478 sed "s|__KUBERNETES_NODE_NAME__|${KUBERNETES_NODE_NAME}|g" /tmp/multus-conf/70-multus.conf.template > /tmp/multus-conf/70-multus.conf
480 --multus-conf-file=/tmp/multus-conf/70-multus.conf
492 mountPath: /host/etc/cni/net.d
494 mountPath: /host/opt/cni/bin
496 #mountPath: /tmp/multus-conf
499 mountPath: /tmp/multus-conf/70-multus.conf.template
500 subPath: "cni-conf.json"
501 - name: kubernetes-cfg-dir
502 mountPath: /etc/kubernetes
512 #name: multus-cni-config
514 #- key: cni-conf.json
515 # path: 70-multus.conf.template
518 name: multus-cni-config
519 - name: kubernetes-cfg-dir
521 path: /etc/kubernetes
526 name: kube-multus-ds-arm64
527 namespace: kube-system
547 beta.kubernetes.io/arch: arm64
551 serviceAccountName: multus
554 #image: nfvpe/multus:v3.3
555 #image: iecedge/multus-arm64:latest
556 #- "--multus-conf-file=auto"
557 #- "--cni-version=0.3.1"
558 image: iecedge/multus-arm64:v3.4
559 imagePullPolicy: IfNotPresent
561 - name: KUBERNETES_NODE_NAME
564 fieldPath: spec.nodeName
570 sed "s|__KUBERNETES_NODE_NAME__|${KUBERNETES_NODE_NAME}|g" /tmp/multus-conf/70-multus.conf.template > /tmp/multus-conf/70-multus.conf
572 --multus-conf-file=/tmp/multus-conf/70-multus.conf
584 mountPath: /host/etc/cni/net.d
586 mountPath: /host/opt/cni/bin
588 #mountPath: /tmp/multus-conf
591 mountPath: /tmp/multus-conf/70-multus.conf.template
592 subPath: "cni-conf.json"
593 - name: kubernetes-cfg-dir
594 mountPath: /etc/kubernetes
604 #name: multus-cni-config
606 #- key: cni-conf.json
607 # path: 70-multus.conf.template
610 name: multus-cni-config
611 - name: kubernetes-cfg-dir
613 path: /etc/kubernetes