Skip to content

Commit ec55003

Browse files
authored
Merge pull request #51582 from serathius/kep-4988-blogpost
Blogpost for KEP-4988
2 parents 4f97476 + eabf3dd commit ec55003

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
layout: blog
3+
title: "Kubernetes v1.34: Snapshottable API server cache"
4+
date: XXX
5+
slug: kubernetes-v1-34-snapshottable-api-server-cache
6+
author: >
7+
[Marek Siarkowicz](https://github.com/serathius) (Google)
8+
draft: true
9+
---
10+
11+
For years, the Kubernetes community has been on a mission to improve the stability and performance predictability of the API server.
12+
A major focus of this effort has been taming **list** requests, which have historically been a primary source of high memory usage and heavy load on the `etcd` datastore.
13+
With each release, we've chipped away at the problem, and today, we're thrilled to announce the final major piece of this puzzle.
14+
15+
The *snapshottable API server cache* feature has graduated to **Beta** in Kubernetes v1.34,
16+
culminating a multi-release effort to allow virtually all read requests to be served directly from the API server's cache.
17+
18+
## Evolving the cache for performance and stability
19+
20+
The path to the current state involved several key enhancements over recent releases that paved the way for today's announcement.
21+
22+
### Consistent reads from cache (Beta in v1.31)
23+
24+
While the API server has long used a cache for performance, a key milestone was guaranteeing *consistent reads of the latest data* from it. This v1.31 enhancement allowed the watch cache to be used for strongly-consistent read requests for the first time, a huge win as it enabled *filtered collections* (e.g. "a list of pods bound to this node") to be safely served from the cache instead of etcd, dramatically reducing its load for common workloads.
25+
26+
### Taming large responses with streaming (Beta in v1.33)
27+
28+
Another key improvement was tackling the problem of memory spikes when transmitting large responses. The streaming encoder, introduced in v1.33, allowed the API server to send list items one by one, rather than buffering the entire multi-gigabyte response in memory. This made the memory cost of sending a response predictable and minimal, regardless of its size.
29+
30+
### The missing piece
31+
32+
Despite these huge improvements, a critical gap remained. Any request for a historical `LIST`—most commonly used for paginating through large result sets—still had to bypass the cache and query `etcd` directly. This meant that the cost of *retrieving* the data was still unpredictable and could put significant memory pressure on the API server.
33+
34+
## Kubernetes 1.34: snapshots complete the picture
35+
36+
The _snapshottable API server cache_ solves this final piece of the puzzle.
37+
This feature enhances the watch cache, enabling it to generate efficient, point-in-time snapshots of its state.
38+
39+
Here’s how it works: for each update, the cache creates a lightweight snapshot.
40+
These snapshots are "lazy copies," meaning they don't duplicate objects but simply store pointers, making them incredibly memory-efficient.
41+
42+
When a **list** request for a historical `resourceVersion` arrives, the API server now finds the corresponding snapshot and serves the response directly from its memory.
43+
This closes the final major gap, allowing paginated requests to be served entirely from the cache.
44+
45+
## A new era of API Server performance 🚀
46+
47+
With this final piece in place, the synergy of these three features ushers in a new era of API server predictability and performance:
48+
49+
1. **Get Data from Cache**: *Consistent reads* and *snapshottable cache* work together to ensure nearly all read requests—whether for the latest data or a historical snapshot—are served from the API server's memory.
50+
2. **Send data via stream**: *Streaming list responses* ensure that sending this data to the client has a minimal and constant memory footprint.
51+
52+
The result is a system where the resource cost of read operations is almost fully predictable and much more resiliant to spikes in request load.
53+
This means dramatically reduced memory pressure, a lighter load on `etcd`, and a more stable, scalable, and reliable control plane for all Kubernetes clusters.
54+
55+
## How to get started
56+
57+
With its graduation to Beta, the `SnapshottableCache` feature gate is **enabled by default** in Kubernetes v1.34. There are no actions required to start benefiting from these performance and stability improvements.
58+
59+
## Acknowledgements
60+
61+
Special thanks for designing, implementing, and reviewing these critical features go to:
62+
* **Ahmad Zolfaghari** ([@ah8ad3](https://github.com/ah8ad3))
63+
* **Ben Luddy** ([@benluddy](https://github.com/benluddy)) – *Red Hat*
64+
* **Chen Chen** ([@z1cheng](https://github.com/z1cheng)) – *Microsoft*
65+
* **Davanum Srinivas** ([@dims](https://github.com/dims)) – *Nvidia*
66+
* **David Eads** ([@deads2k](https://github.com/deads2k)) – *Red Hat*
67+
* **Han Kang** ([@logicalhan](https://github.com/logicalhan)) – *CoreWeave*
68+
* **haosdent** ([@haosdent](https://github.com/haosdent)) – *Shopee*
69+
* **Joe Betz** ([@jpbetz](https://github.com/jpbetz)) – *Google*
70+
* **Jordan Liggitt** ([@liggitt](https://github.com/liggitt)) – *Google*
71+
* **Łukasz Szaszkiewicz** ([@p0lyn0mial](https://github.com/p0lyn0mial)) – *Red Hat*
72+
* **Maciej Borsz** ([@mborsz](https://github.com/mborsz)) – *Google*
73+
* **Madhav Jivrajani** ([@MadhavJivrajani](https://github.com/MadhavJivrajani)) – *UIUC*
74+
* **Marek Siarkowicz** ([@serathius](https://github.com/serathius)) – *Google*
75+
* **NKeert** ([@NKeert](https://github.com/NKeert))
76+
* **Tim Bannister** ([@lmktfy](https://github.com/lmktfy))
77+
* **Wei Fu** ([@fuweid](https://github.com/fuweid)) - *Microsoft*
78+
* **Wojtek Tyczyński** ([@wojtek-t](https://github.com/wojtek-t)) – *Google*
79+
80+
...and many others in SIG API Machinery. This milestone is a testament to the community's dedication to building a more scalable and robust Kubernetes.

0 commit comments

Comments
 (0)