Kubernetes Blog
Follow
Kubernetes v1.31: Accelerating Cluster Performance with Consistent Reads from Cache
Kubernetes v1.31 introduces consistent reads from cache, a significant performance improvement for large-scale clusters. This feature ensures accurate cluster state for Kubernetes components by leveraging etcd's progress notifications to guarantee cache freshness. By serving reads directly from the cache, it reduces etcd load, lowers latency, and enhances scalability.Consistent reads are crucial for maintaining cluster reliability and enabling informed decision-making. Previously, filtering data in large clusters required fetching the entire dataset from etcd, creating a performance bottleneck. The cache now stores a snapshot of the cluster state and receives updates through etcd watches.When a consistent read is requested, the system checks the cache's freshness using etcd progress notifications. If the cache is up-to-date, the read is served directly from it. If not, progress notifications are queried until freshness is confirmed.This optimization significantly improves performance, especially for filtered data requests, as only minimal metadata needs to be read from etcd. Tests on 5,000-node clusters showed a 30% reduction in kube-apiserver CPU usage and a 25% reduction in etcd CPU usage.To benefit from this feature, Kubernetes clusters must run etcd version 3.4.31+ or 3.5.13+. Consistent reads from cache are enabled by default in Kubernetes v1.31.The Kubernetes community is exploring pagination support in the watch cache for further performance optimizations. Users can experience the benefits by upgrading to Kubernetes v1.31 and using a supported etcd version.