Kubernetes v1.36: Server-Side Sharded List and Watch
Kubernetes v1.36 adds alpha server-side sharded list and watch (KEP-5866), letting the API server filter list responses and watch events so each horizontally scaled controller replica receives only its slice of a resource collection instead of deserializing and discarding the full stream. Clients set a new `shardSelector` in ListOptions using `shardRange()` over `object.metadata.uid` or `object.metadata.namespace`. The server matches objects by a deterministic 64-bit FNV-1a hash within `[start, end)`, so results are consistent across API server replicas, and `||` lets one replica cover non-contiguous ranges. Controllers inject the selector through informer `WithTweakListOptions`. They should check for `shardInfo` in the response metadata and fall back to client-side filtering when the server did not honor the selector.
Related posts
- Kubernetes v1.37: etcd RangeStream Cuts Memory Use on Large List Reads
Kubernetes Blog mediumAdeptKubernetes v1.37 promotes etcd RangeStream to beta and enables it by default via the EtcdRangeStream feature gate. When paired with etcd v3.7, the API server reads whole collections, such as during watch cache initialization and uncached list fallbacks, through a streaming RPC instead of key-count-paginated Range calls. Previously a full page sat in memory on both etcd and the API server at once. With RangeStream, chunks are sized adaptively by bytes and are decoded and freed one at a time, which lowers peak memory and OOM risk. The API server falls back to paginated Range automatically on older etcd, and a non-zero etcd_request_duration_seconds_count{operation="listStream"} metric confirms the streaming path is in use.
- How the controller-runtime Cache Actually Works, and Why Your Controller Does Not Crash the API Server
Kubernetes Blog hardMasterIn controller-runtime, r.Get() and r.List() inside a reconciler read from a local in-memory cache built on client-go informers. That cache is filled by a list + watch (now a streaming list with sendInitialEvents) and kept current by the Reflector using resourceVersion, with relists only after 410 Gone. Since client-go 1.36 the delta queue is RealFIFO, which delivers every delta in global order with no deduplication; coalescing of bursts happens only in the controller's workqueue, keyed by namespace/name. The design makes reads nearly free, but it brings stale reads after writes, memory growth from cached objects and indexes, and hidden O(n) List scans, and occasionally a need for APIReader.
- Announcing etcd v3.7.0
Kubernetes Blog hardMasteretcd v3.7.0 adds RangeStream, an RPC that returns large range results in chunks so neither server nor client has to buffer the whole response. It will reach Kubernetes v1.37 behind the EtcdRangeStream feature gate. Other performance changes include keys-only ranges served straight from the in-memory index without reading bbolt, prioritized LeaseRevoke and a FastLeaseKeepAlive that skips waiting for the applied index, and faster interval-tree find() for watches. The server now bootstraps entirely from v3store, the gogo and golang protobuf libraries are replaced with google.golang.org/protobuf, and experimental flags and legacy v2 packages are removed, so operators should do rolling upgrades and Go module consumers may need code changes.
- Kubernetes v1.36: Mixed Version Proxy Graduates to Beta
Kubernetes Blog hardMasterKubernetes 1.36 promotes the Mixed Version Proxy (feature gate UnknownVersionInteroperabilityProxy) to beta and enables it by default. During HA control-plane upgrades, an API server that cannot serve a requested resource now proxies the request to a capable peer instead of returning an incorrect 404, which could otherwise trigger mistaken garbage collection or blocked namespace deletions. Since alpha, peer capability lookup has moved from the StorageVersion API to Aggregated Discovery so CRDs and aggregated APIs are covered. Peer-aggregated discovery now merges all peers' APIs into one discovery document, with profile=nopeer available for a local-only view. Operators must set --peer-ca-file, and optionally --peer-advertise-ip/port, or proxying fails on TLS verification.
- Kubernetes v1.37: Garhwal
Kubernetes Blog mediumAdeptKubernetes v1.37 ships 67 enhancements: 16 Stable, 23 Beta, 27 Alpha and 1 deprecation. Highlights include stable resilient watch cache initialization, where kube-apiserver now returns HTTP 429 instead of overloading etcd, so clients should honor Retry-After and back off. HPA scale-to-zero reaches Beta for object and external metrics, admission policies can be loaded from static manifests, and Pod-level checkpoint/restore arrives in Alpha via new CRI RPCs. Stable graduations include KYAML, metrics.k8s.io v1, SELinux mount-based labeling (which can break Pods with different labels sharing a volume), several DRA features, StorageVersionMigration, and Pod certificates with ClusterTrustBundles.