Cloud Computing and Data Centers

Performance Improvements for Kyverno Kubernetes Policy Engine and Addressing Inspection Costs

The Kyverno project development team revealed the resolution of a core performance flaw in the Common Expression Language (CEL)-based admission control engine, where object conversion was consuming approximately 86% of total resources prior to the new 1.19.2 release.

2026-11-18
3 min read
24 views
certi.news Editorial Team
Performance Improvements for Kyverno Kubernetes Policy Engine and Addressing Inspection Costs

Recent performance tests for the Kubernetes policy project (Kyverno) showed that the Common Expression Language (CEL)-based admission control engine suffered from unexpectedly low efficiency, with the vast majority of memory allocations going toward preparing objects for the evaluation process rather than evaluating the policies themselves. It was found that approximately 86% of total allocated memory was consumed by object conversion, leading to performance degradation as the number of enabled policies increased.

This discovery came after a review of general performance benchmarks that placed the Kyverno engine behind other alternatives. While comparisons previously focused on the legacy (ClusterPolicy) engine based on (JMESPath), a deep inspection of the newer (CEL)-based engine prompted developers to track and address the causes of resource waste in the new 1.19.2 release.

What has practically changed in the new release?

In previous versions, the API Server sent the object to be inspected as raw JSON bytes, and the Kyverno engine parsed it within the loop of each matching policy. Due to the application of security standards such as Pod Security Standards, about 16 policies might match the creation of a single Pod object, which resulted in parsing the same object 16 times repeatedly and inefficiently.

The software fix adopted moved the object conversion process entirely outside the individual policy loop. The engine now builds the (CEL) request only once before starting the inspection loop, and all matching policies benefit from it automatically. As a result, the cost of object conversion dropped from 86.8% to only 2.9% of total allocated memory, while processing time decreased significantly under heavy loads.

Performance comparison with native Kubernetes policies

Developers conducted a direct performance comparison between the (CEL) policy engine in Kyverno and the native Kubernetes admission control engine (ValidatingAdmissionPolicy) using a set of 16 standard policies:

  • When applying a single policy, the native Kubernetes engine outperforms with about 9.2 milliseconds versus 12.8 milliseconds for Kyverno.
  • When activating the full set of 16 policies, Kyverno pulls ahead to achieve about 20 milliseconds versus 29 milliseconds for the native engine.
  • In terms of CPU consumption, the Kyverno engine used about 3.2 cores compared to 8.2 cores consumed by the native API server engine under the same loads.

This discrepancy illustrates that the native Kubernetes engine distributes each policy separately, which increases costs as the number of policies grows, whereas Kyverno bears the network and webhook cost once per request regardless of the number of enabled policies.

Limitations and experimental scope

The development team confirmed that these figures are derived from a controlled test environment based on single-machine architectural measurements without accounting for full network latency across multiple nodes in real production environments, encouraging development teams to run their own performance tests to verify actual behavior within their infrastructure.

News source
c
Author

certi.news Editorial Team

In the same category

You may also like

View all news