Add qat device plugin to anisble bootstrap
This commit enables qat device plugin on each node where intelqat=enabled label is set. The daemonset collects qat VF instances on the node and add them up to qat resource pool: qat.intel.com/generic. By default, qat device plugin supports: DH895xCC, C62x, C3xxx and D15xx devices. Story: 2005514 Task: 37083 Depends-On: https://review.opendev.org/#/c/666510/ Change-Id: If948e3fbd6466149c85096e631d6237e1f736a0b Signed-off-by: Mingyuan Qi <mingyuan.qi@intel.com>
This commit is contained in:
@@ -306,3 +306,4 @@ wipe_ceph_osds: false
|
||||
|
||||
k8s_plugins:
|
||||
# intel-gpu-plugin: intelgpu=enabled
|
||||
# intel-qat-plugin: intelqat=enabled
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Create Intel QAT device plugin config file
|
||||
template:
|
||||
src: "intel-qat-plugin.yaml.j2"
|
||||
dest: /etc/kubernetes/intel-qat-daemonset.yaml
|
||||
|
||||
- name: Activate Intel QAT device plugin
|
||||
command: "kubectl --kubeconfig=/etc/kubernetes/admin.conf apply -f /etc/kubernetes/intel-qat-daemonset.yaml"
|
||||
@@ -0,0 +1,101 @@
|
||||
# Intel QAT device plugin
|
||||
# Based on:
|
||||
# https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/deployments/qat_plugin/qat_plugin.yaml
|
||||
# and
|
||||
# https://github.com/intel/intel-device-plugins-for-kubernetes/blob/master/deployments/qat_plugin/qat_plugin_default_configmap.yaml
|
||||
#
|
||||
# The following modifications have been made:
|
||||
# - A nodeSelector of 'intelqat' has been added to ensure the qat device plugin
|
||||
# pods only run on appropriately labelled nodes.
|
||||
# - The daemonset is modified to tolerate all NoSchedule taints
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: intel-device-plugin
|
||||
namespace: kube-system
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: intel-qat-plugin-config
|
||||
namespace: kube-system
|
||||
data:
|
||||
DPDK_DRIVER: "vfio-pci"
|
||||
KERNEL_VF_DRIVERS: "dh895xccvf,c6xxvf,c3xxxvf,d15xxvf"
|
||||
MAX_NUM_DEVICES: "32"
|
||||
DEBUG: "false"
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: intel-qat-plugin
|
||||
namespace: kube-system
|
||||
labels:
|
||||
app: intel-qat-plugin
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: intel-qat-plugin
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: intel-qat-plugin
|
||||
spec:
|
||||
nodeSelector:
|
||||
intelqat: enabled
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
effect: NoSchedule
|
||||
serviceAccountName: intel-device-plugin
|
||||
imagePullSecrets:
|
||||
- name: docker-registry-secret
|
||||
containers:
|
||||
- name: intel-qat-plugin
|
||||
env:
|
||||
- name: NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
image: "{{ docker_registry.url }}/starlingx/intel-qat-plugin:master-distroless-stable-latest"
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
env:
|
||||
- name: DPDK_DRIVER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: intel-qat-plugin-config
|
||||
key: DPDK_DRIVER
|
||||
- name: KERNEL_VF_DRIVERS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: intel-qat-plugin-config
|
||||
key: KERNEL_VF_DRIVERS
|
||||
- name: MAX_NUM_DEVICES
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: intel-qat-plugin-config
|
||||
key: MAX_NUM_DEVICES
|
||||
- name: DEBUG
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: intel-qat-plugin-config
|
||||
key: DEBUG
|
||||
imagePullPolicy: IfNotPresent
|
||||
args: ["-dpdk-driver", "$(DPDK_DRIVER)", "-kernel-vf-drivers", "$(KERNEL_VF_DRIVERS)", "-max-num-devices", "$(MAX_NUM_DEVICES)", "-debug", "$(DEBUG)"]
|
||||
volumeMounts:
|
||||
- name: pcidir
|
||||
mountPath: /sys/bus/pci
|
||||
- name: kubeletsockets
|
||||
mountPath: /var/lib/kubelet/device-plugins
|
||||
volumes:
|
||||
- name: pcidir
|
||||
hostPath:
|
||||
path: /sys/bus/pci
|
||||
- name: kubeletsockets
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/device-plugins
|
||||
Reference in New Issue
Block a user