Web servers, API gateways, and databases that handle high volumes of Transport Layer Security (TLS) traffic consume significant CPU capacity on cryptographic operations. Intel® QuickAssist Technology (QAT) is a hardware accelerator built into Intel® Xeon® Scalable processors that offloads symmetric and asymmetric encryption and decryption, compression, and decompression from CPU cores to dedicated hardware—reducing CPU utilization and improving throughput.
ack-qat-deviceplugin, developed from the OpenAnolis intel-accel-plugin-qat open source project, exposes QAT devices on eighth-generation Elastic Compute Service (ECS) Bare Metal Instances (Intel Sapphire Rapids) as on-demand Kubernetes resources. Applications such as NGINX and Envoy request QAT devices via standard Kubernetes resource limits, offloading TLS and GNU zip (Gzip) operations from the CPU.
QAT resource naming
After deploying ack-qat-deviceplugin, each node exposes QAT capacity using the resource name qat.intel.com/cy{N}_dc{N}, where:
-
cy{N}is the number of work queues for encryption and decryption -
dc{N}is the number of work queues for compression and decompression
For example, qat.intel.com/cy2_dc2 means each QAT virtual function (VF) has two work queues for cryptographic operations and two for compression. For an ecs.ebmg8i.48xlarge instance, each QAT device has two work queues for encryption and decryption and two work queues for compression and decompression. Use this resource name in pod limits to allocate QAT devices to your workloads. The exact name depends on your hardware configuration and the setup.vf_per_pf setting.
Limitations
-
Instance type: Use ECS Bare Metal Instances in the
ecs.ebmg8iorecs.ebmc8iinstance families. The examples in this topic useecs.ebmg8i.48xlarge. These instance families are only available in select regions. To check availability, see Instance types available for each region. -
Operating system: Alibaba Cloud Linux UEFI 3.2104 Security Enhanced.
-
Conflicting device plugins: If a device plugin from another provider is already installed to expose QAT devices, uninstall it before proceeding.
Prerequisites
Before you begin, ensure that you have:
Step 1: Configure nodes
Before using QAT devices for the first time, update the kernel parameters on your nodes and reboot.
To avoid re-running this script each time a node is added, create a dedicated node pool for ecs.ebmg8i or ecs.ebmc8i instances and add this script to the user data field of the node pool—not to the pre-defined custom data field. Adding it to pre-defined custom data prevents nodes from joining the cluster. For details, see Create a node pool.
yum install kernel-0:5.10.134-16.1.al8.x86_64 -y
if [ $? -ne 0 ];then
echo "Error: yum update failed"
fi
yum install kernel-modules -y
if [ $? -ne 0 ];then
echo "Error: yum install kernel-modules failed"
fi
kernel_path=$(grubby --default-kernel)
kernel_args="intel_iommu=on iommu=pt"
grubby --update-kernel=$kernel_path --args=$kernel_args
reboot -f
Step 2: Deploy ack-qat-deviceplugin
-
Install
ack-qat-devicepluginusing Helm:Parameter Required Description Default regionIdNo Region where the cluster resides. When set, the chart is pulled over the internal network. None setup.vf_per_pfNo Number of virtual functions (VFs) to create per physical function (PF). Valid values: 0–16. 16setup.enabled_modeNo Driver mode for QAT devices. Valid values: sym(symmetric encryption and decryption),asym(asymmetric encryption and decryption),dc(compression and decompression). Specify up to two modes, separated by semicolons. For example,asym;dcenables both asymmetric crypto and compression. For the full parameter reference, see sysfs-driver-qat.asym;dchelm install ack-qat-deviceplugin https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/pre/charts-incubator/ack-qat-deviceplugin-0.1.2.tgz \ --set regionId="cn-beijing" \ --set setup.vf_per_pf="16" \ --set setup.enabled_mode="asym;dc" -
Label the nodes where you want to deploy
ack-qat-deviceplugin:kubectl label node cn-beijing.172.17.XX.XX "alibabacloud.com/type"="ebmg8i"
Step 3: Verify plugin registration
After installation, wait a few minutes for the pod to start, then confirm that ack-qat-deviceplugin is running in the kube-system namespace.
Query the available QAT VFs on your nodes:
kubectl get nodes -o go-template='{{range .items}}{{.metadata.name}}{{"\n"}}{{range $k,$v:=.status.allocatable}}{{" "}}{{$k}}{{": "}}{{$v}}{{"\n"}}{{end}}{{end}}'
Expected output:
cn-beijing.172.17.XX.XX
cpu: 189280m
ephemeral-storage: 113783349470
hugepages-1Gi: 0
hugepages-2Mi: 0
memory: 1027672932Ki
pods: 2133
qat.intel.com/cy2_dc2: 32
The qat.intel.com/cy2_dc2: 32 entry confirms that QAT VFs are available. For an ecs.ebmg8i.48xlarge instance, the total VF count equals twice the setup.vf_per_pf value. With the default value of 16, you get 32 VFs.
Step 4: Deploy an application with QAT acceleration
This example uses BoringSSL and Envoy to show how to offload TLS encryption and decryption to QAT hardware. BoringSSL is an open source cryptographic library and Envoy is a cloud-native gateway commonly used for microservices communication.
-
Create a self-signed certificate and store it as a Kubernetes Secret:
openssl req -x509 -new -batch -nodes -subj '/CN=localhost' -keyout key.pem -out cert.pem kubectl create secret tls envoy-tls-secret --cert cert.pem --key key.pem -
Create an Envoy ConfigMap that enables QAT-backed TLS via the
private_key_providersfeature: -
Deploy the Envoy application and Service. Mount the Secret and ConfigMap created in the previous steps as volumes. All pod specs in this example use the
envoy-accelimage from OpenAnolis, which includes Intel QAT acceleration support for TLS and Gzip. A single-process Envoy instance requires one QAT device, soqat.intel.com/cy2_dc2is set to1in the resource limits. -
Verify that QAT hardware is handling the TLS operations.
-
On the node running Envoy, record the current QAT firmware request count:
# Log on to the node on which Envoy is deployed. cat /sys/kernel/debug/qat_4xxx_0000\:e8\:00.0/fw_countersExpected output before any traffic:
-
Send a request to the Service using the certificate:
# Access the Service from the client on which the Secret is created. kubectl port-forward svc/helloenvoy 32296:9000 curl --cacert cert.pem https://localhost:32296 -vExpected output:
-
Check the firmware counter again on the node:
# Log on to the node on which Envoy is deployed. cat /sys/kernel/debug/qat_4xxx_0000\:e8\:00.0/fw_countersExpected output after traffic:
The increment in
Firmware Requests [AE 0]andFirmware Responses [AE 0]confirms that the TLS handshake was processed by QAT hardware rather than the CPU.
-