Skip to content

investigate if we get server side sharded list and watch out of the box with k8s 1.36 #4459

Closed

Description

@neolit123

Kubernetes v1.36 introduces server-side sharded list and watch as an alpha feature (KEP-5866). With this feature enabled, the API server filters events at the source so that each controller replica receives only the slice of the resource collection it owns

https://kubernetes.io/blog/2026/05/06/kubernetes-v1-36-server-side-sharded-list-and-watch/

check if kcp supports it too.

cc @SimonTheLeg

Activity

  1. self-assigned this
    on Oct 12, 2026
  2. added
    kind/choreCategorizes issue or PR as related to maintenance and other usually non-code changes.
    on Oct 12, 2026
  3. neolit123 commented on Oct 13, 2026

    @neolit123
    ContributorAuthor

    ran a test script to verify various cases:

    ./kcp-verify-list-watch-sharding.sh
    
    building kcp...
    starting kcp with ShardedListAndWatch=true...
    creating test data...
    
    test case 1: list configmaps in one workspace; the two halves must add up to the full list and return shardInfo
      full=21 lower=10 upper=11 watch(lower)=10 shardInfo=shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000')
      -> PASS
    
    test case 2: watch configmaps in one workspace; only newly created objects in the lower half must arrive
      received=[cm-101 cm-102 cm-106 cm-113 cm-119]
      expected=[cm-101 cm-102 cm-106 cm-113 cm-119]
      -> PASS
    
    test case 3: list and watch configmaps across all workspaces (wildcard /clusters/*)
      full=50 lower=20 upper=30 watch(lower)=20 shardInfo=shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000')
      -> PASS
    
    test case 4: list and watch a CRD-backed resource in a child workspace
      full=20 lower=9 upper=11 watch(lower)=9 shardInfo=<none>
      -> FAIL
    
    test case 5: list and watch through the APIExport virtual workspace (tenancy.kcp.io workspacetypes)
      full=5 lower=4 upper=1 watch(lower)=4 shardInfo=<none>
      -> FAIL
    
    test case 6: shard by namespace across all workspaces; works, but every workspace's 'default' namespace lands in the same half
      full=50 lower=42 upper=8 watch(lower)=42 shardInfo=shardRange(object.metadata.namespace, '0x0000000000000000', '0x8000000000000000')
      -> PASS
    
    restarting kcp with ShardedListAndWatch=false...
    
    test case 7: with the feature gate off, the selector must be ignored and no shardInfo returned
      full=41 lower=41 shardInfo=<none>
      -> PASS
    

    the 4 and 5 cases are with CRDs and they fail. upstream needs this fix, so i submitted a PR; don't know if it can land in .38:

  4. neolit123 commented on Oct 14, 2026

    @neolit123
    ContributorAuthor

    update

    ^ was approved and will merge for 1.38.
    the feature is maybe graduating to beta in 1.38 too.

    summary: all the above cases will work in 1.38, but 4 and 5 (which is effectively CRD support) don't work for < 1.38.
    it's a bug, but backporting fixes for alpha features is generally not accepted unless it's very blocking and core types do support the sharding, so it kind of is not very blocking. so this is borderline backportable to older k8s but i would prefer to not propose it, for now.

  5. moved this from New to Done in kcpon Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/choreCategorizes issue or PR as related to maintenance and other usually non-code changes.

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions