{"id":119,"date":"2026-06-02T16:53:02","date_gmt":"2026-06-02T16:53:02","guid":{"rendered":"https:\/\/cgh.mx\/?p=119"},"modified":"2026-06-02T16:53:03","modified_gmt":"2026-06-02T16:53:03","slug":"kubernetes-1-36-sharded-list-watch-explained","status":"publish","type":"post","link":"https:\/\/cgh.mx\/?p=119","title":{"rendered":"Kubernetes 1.36 makes large-cluster watches smarter"},"content":{"rendered":"<h1>Kubernetes 1.36 makes large-cluster watches smarter<\/h1>\n<p>Kubernetes 1.36 introduces an alpha feature called <strong>server-side sharded list and watch<\/strong>. That name sounds internal, but the problem it addresses is very real for large clusters: horizontally scaled controllers can waste a lot of CPU, memory, and network bandwidth processing events they will immediately discard.<\/p>\n<p>This feature does not matter much for small clusters. It matters when the number of objects is high, the controllers are scaled out, and every replica is still receiving the full event stream from the API server.<\/p>\n<h2>The problem: every replica sees too much<\/h2>\n<p>Kubernetes controllers commonly use the list-then-watch pattern. They list the current state of resources, then watch for changes so they can keep their local cache in sync.<\/p>\n<p>That model works well, but it becomes expensive at scale. If a controller has multiple replicas and each replica is responsible for only part of the workload, the API server may still send every replica the full stream of objects and events. Each replica then filters locally and discards what it does not own.<\/p>\n<p>The result is waste:<\/p>\n<ul>\n<li>repeated network traffic<\/li>\n<li>repeated deserialization work<\/li>\n<li>higher CPU and memory usage per replica<\/li>\n<li>API server pressure that grows with controller replicas<\/li>\n<li>limited benefit from horizontal scaling<\/li>\n<\/ul>\n<p>In other words, adding more replicas may help distribute business logic, but it does not necessarily reduce the cost of watching Kubernetes resources.<\/p>\n<h2>What server-side sharding changes<\/h2>\n<p>Server-side sharded list and watch moves part of that filtering into the API server.<\/p>\n<p>Instead of every controller replica receiving the full collection, each replica can request a specific shard. Kubernetes uses a <code>shardSelector<\/code> in <code>ListOptions<\/code> with a hash range expression. The API server evaluates the selector and sends only the objects whose metadata hash falls into that replica\u2019s assigned range.<\/p>\n<p>For Kubernetes 1.36, the feature supports hashing fields such as <code>object.metadata.uid<\/code> and <code>object.metadata.namespace<\/code>. The API server uses a deterministic 64-bit FNV-1a hash so the same object maps consistently to the same shard range.<\/p>\n<p>The important part is simple: each replica receives less irrelevant data.<\/p>\n<h2>Why this matters for operators<\/h2>\n<p>This is an API machinery feature, but operators should care because it targets one of the hidden costs of large Kubernetes clusters.<\/p>\n<p>In a large environment, controllers that watch high-cardinality resources like Pods can become expensive even when they are well-written. If every replica receives everything, the control plane pays a repeated cost. Server-side sharding gives controller authors a way to reduce that cost closer to the source.<\/p>\n<p>Potential benefits include:<\/p>\n<ul>\n<li>lower network traffic from the API server to controller replicas<\/li>\n<li>less wasted CPU on each replica<\/li>\n<li>better scaling behavior for horizontally sharded controllers<\/li>\n<li>improved efficiency for high-cardinality resources<\/li>\n<li>cleaner alignment between controller ownership and API traffic<\/li>\n<\/ul>\n<p>This is especially relevant for projects that already shard work client-side, because they may be able to stop receiving data they were only going to discard.<\/p>\n<h2>The alpha warning matters<\/h2>\n<p>This feature is alpha in Kubernetes 1.36 and disabled by default. That is important.<\/p>\n<p>Alpha means it is not something to casually depend on for production behavior unless you are intentionally testing it and understand the risk. It requires enabling the <code>ShardedListAndWatch<\/code> feature gate on the API server, and clients need to handle fallback cases.<\/p>\n<p>The Kubernetes documentation notes that responses can include <code>shardInfo<\/code> metadata when the server honors the selector. If that information is absent, the client should assume the server did not apply the shard and be ready to handle the full result set.<\/p>\n<p>That fallback requirement is not a minor detail. Controller authors cannot assume every cluster they run against will support the feature.<\/p>\n<h2>Who should pay attention now<\/h2>\n<p>Most everyday Kubernetes users do not need to change anything today.<\/p>\n<p>The people who should pay attention are:<\/p>\n<ul>\n<li>controller authors<\/li>\n<li>platform teams running very large clusters<\/li>\n<li>teams operating high-cardinality resources<\/li>\n<li>maintainers of observability or state-reporting controllers<\/li>\n<li>engineers already using client-side sharding patterns<\/li>\n<\/ul>\n<p>For those groups, this is worth testing early because it could influence future controller architecture.<\/p>\n<h2>Why this matters beyond one release<\/h2>\n<p>Kubernetes keeps improving scalability not only through big visible features, but through lower-level changes that reduce control plane waste. Server-side sharded list and watch fits that pattern.<\/p>\n<p>It recognizes that large clusters are not just \u201csmall clusters with more nodes.\u201d At scale, repeated streams, duplicated processing, and inefficient watches become real operational costs.<\/p>\n<p>If this feature matures, it could make horizontally scaled controllers more efficient and make Kubernetes friendlier to very large environments.<\/p>\n<h2>The practical takeaway<\/h2>\n<p>Kubernetes 1.36 server-side sharded list and watch is not a feature most users will touch directly today. It is an alpha building block for controller authors and large-cluster operators.<\/p>\n<p>The practical takeaway is this: Kubernetes is giving controllers a way to ask the API server for only the slice of the world they are responsible for. If it matures, that could make large clusters less wasteful and easier to scale.<\/p>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/kubernetes.io\/blog\/2026\/05\/06\/kubernetes-v1-36-server-side-sharded-list-and-watch\/\">Kubernetes Blog: Kubernetes v1.36 Server-Side Sharded List and Watch<\/a><\/li>\n<li><a href=\"https:\/\/kubernetes.io\/docs\/reference\/using-api\/api-concepts\/#sharded-list-and-watch\">Kubernetes API Concepts: Sharded list and watch<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/kubernetes\/enhancements\/issues\/5866\">KEP-5866: Server-Side Sharded List and Watch<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes 1.36 adds alpha server-side sharded list and watch, helping large controllers avoid processing event streams they do not own.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[120,119,121,114,118,122],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-infrastructure","tag-api-server","tag-containers","tag-controllers","tag-devops","tag-kubernetes","tag-scalability"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/cgh.mx\/index.php?rest_route=\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cgh.mx\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cgh.mx\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cgh.mx\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cgh.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":1,"href":"https:\/\/cgh.mx\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":150,"href":"https:\/\/cgh.mx\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions\/150"}],"wp:attachment":[{"href":"https:\/\/cgh.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cgh.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cgh.mx\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}