You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clients can also specify multiple hash ranges simultaneously using the logical OR
337
+
operator (`||`) implemented by the CEL evaluator.
339
338
340
-
-`selector`: Introduces a new query parameter to encapsulate expression-based selection logic.
341
-
-`shardRange(...)`: A function within the selector grammar that specifies the field to hash (e.g., `object.metadata.uid`) and the start and end range (`start <= x < end`) of hash values this client desires. This provides a future-proof foundation without bloating `ListOptions` with multiple individual parameter fields.
- Clients must be updated to send the new parameters.
554
557
- If a client sends sharding parameters to an old API server, the old server will ignore the unknown query parameters and send the full, un-sharded stream.
555
-
- To allow clients to safely distinguish between a filtered stream and a full stream, the API Server will inject a new `Sharded: true` flag into the `ListMeta` of the initial `LIST` response (and the initial sync of a `WATCH`).
556
-
- If a client requests a shard and observes `Sharded: true`, it can safely process all incoming events.
557
-
- If the flag is missing or false, the client knows the server ignored the parameter and must perform client-side filtering (or fail) to drop objects outside its shard range.
558
+
- To allow clients to safely distinguish between a filtered stream and a full stream,
559
+
the API Server will return a new `ShardInfo` struct within the `ListMeta` of the
560
+
initial `LIST` response (and initial sync of a `WATCH`).
561
+
- The `ShardInfo` struct mirrors the applied selector back to the client via a `selector` string field.
562
+
- If a client requests a shard and observes a matching `ShardInfo.selector`, it can
563
+
safely construct partial lists, process incoming events, or merge responses
564
+
across multiple shards.
565
+
- If `ShardInfo` is absent, the client knows the server ignored the parameter
566
+
and can take appropriate action to avoid breaking mutual exclusion like falling back to
567
+
client-side sharding.
558
568
- Clients can also deterministically check for server-side sharding support by querying the OpenAPI v3 discovery document for the presence of the sharding query parameters.
559
569
- To enable safe client-side fallback, the hash algorithm and range evaluation logic will be placed in a common library (`k8s.io/apimachinery`).
560
570
@@ -591,7 +601,7 @@ This section must be completed when targeting alpha to a release.
591
601
###### How can this feature be enabled / disabled in a live cluster?
592
602
593
603
-[x] Feature gate (also fill in values in `kep.yaml`)
594
-
- Feature gate name: `ShardableWatch`
604
+
- Feature gate name: `ShardedListAndWatch`
595
605
- Components depending on the feature gate: `kube-apiserver`
596
606
597
607
###### Does enabling the feature change any default behavior?
@@ -730,6 +740,8 @@ Latency for sharded watches should be comparable to standard watches.
730
740
-[x] Metrics
731
741
- Metric name: `apiserver_watch_shards_total`
732
742
- Components exposing the metric: `kube-apiserver`
0 commit comments