2022-08-31 11:33:07 -03:00
|
|
|
.. _k8s_qat_device_plugin:
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
.. only:: starlingx
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
==========================================
|
|
|
|
Kubernetes QAT Device Plugin Configuration
|
|
|
|
==========================================
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
Intel® QuickAssist Technology (Intel® QAT) accelerates cryptographic workloads
|
|
|
|
by offloading the data to hardware capable of optimizing those functions. This
|
|
|
|
guide describes how to enable and consume the Intel QAT device plugin in
|
|
|
|
StarlingX.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
.. contents::
|
|
|
|
:local:
|
|
|
|
:depth: 1
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
-------------
|
|
|
|
Prerequisites
|
|
|
|
-------------
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
- Install Intel QuickAssist device on host.
|
|
|
|
- Install StarlingX on bare metal with DPDK enabled. Refer to the |_link-inst-book|
|
|
|
|
for details.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
------------------------------
|
|
|
|
Enable Intel QAT device plugin
|
|
|
|
------------------------------
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
The Intel QAT device plugin daemonset is pre-installed in StarlingX. This
|
|
|
|
section describes the steps to enable the Intel QAT device plugin for
|
|
|
|
discovering and advertising QAT VF resources to Kubernetes host.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
#. Verify QuickAssist SR-IOV virtual functions are configured on a specified
|
|
|
|
node after StarlingX is installed. This example uses the worker-0 node.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
$ ssh worker-0
|
|
|
|
$ for i in 0442 0443 37c9 19e3; do lspci -d 8086:$i; done
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
.. note::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
The Intel QAT device plugin only supports QAT VF resources in the current
|
|
|
|
release.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
#. Assign the ``intelqat`` label to the node (worker-0 in this example).
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
$ NODE=worker-0
|
|
|
|
$ system host-lock $NODE
|
|
|
|
$ system host-label-assign $NODE intelqat=enabled
|
|
|
|
$ system host-unlock $NODE
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
#. After the node becomes available, verify the Intel QAT device plugin is
|
|
|
|
registered.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
$ kubectl describe node $NODE | grep qat.intel.com/generic
|
|
|
|
qat.intel.com/generic: 10
|
|
|
|
.intel.com/generic: 10
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
-------------------------------
|
|
|
|
Consume Intel QAT device plugin
|
|
|
|
-------------------------------
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
#. Build the DPDK image.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
$ git clone https://github.com/intel/intel-device-plugins-for-kubernetes.git
|
|
|
|
$ cd demo
|
|
|
|
$ ./build-image.sh crypto-perf
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
This command produces a Docker image named ``crypto-perf``.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
#. Deploy a pod to run an example DPDK application named
|
|
|
|
``dpdk-test-crypto-perf``.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
In the pod specification file, add the container resource request and
|
|
|
|
limit.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
For example, use ``qat.intel.com/generic: <number of devices>`` for a
|
|
|
|
container requesting Intel QAT devices.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
For a DPDK-based workload, you may need to add a hugepage request and limit.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
$ kubectl apply -k deployments/qat_dpdk_app/base/
|
|
|
|
$ kubectl get pods
|
|
|
|
NAME READY STATUS RESTARTS AGE
|
|
|
|
qat-dpdk 1/1 Running 0 27m
|
|
|
|
intel-qat-plugin-5zgvb 1/1 Running 0 3h
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
.. Note::
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
The deployment example above uses kustomize, which is a tool supported by
|
|
|
|
kubectl since the Kubernetes v1.14 release.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
#. Manually execute the ``dpdk-test-crypto-perf`` application to review the
|
|
|
|
logs.
|
2019-11-25 16:04:50 +08:00
|
|
|
|
2022-08-31 11:33:07 -03:00
|
|
|
::
|
|
|
|
|
|
|
|
$ kubectl exec -it qat-dpdk bash
|
|
|
|
|
|
|
|
$ ./dpdk-test-crypto-perf -l 6-7 -w $QAT1 -- --ptest throughput --\
|
|
|
|
devtype crypto_qat --optype cipher-only --cipher-algo aes-cbc --cipher-op \
|
|
|
|
encrypt --cipher-key-sz 16 --total-ops 10000000 --burst-sz 32 --buffer-sz 64
|
2019-11-25 16:04:50 +08:00
|
|
|
|