Repository navigation
feat(api): Let a ServiceEndpoint spread traffic across its producers - #1092
Merged
Merged
Conversation
A private service endpoint can have only one ready producer on each node and VPC, so a service that runs two replicas per node for rollouts and crash tolerance needs one consumer address per replica, and clients then lean on the first address and wait out timeouts on the second. ServiceEndpoint gains spec.distribution, Single by default and Spread to send a consumer's traffic to every ready producer on its node, and spec.healthCheck, a TCP probe of each producer that Spread requires and every other distribution refuses. A udp endpoint's health check must name a TCP port. The endpoint gets a status subresource whose status.producers lists each producer's health decision, keyed by the attachment's namespace and name, so each node can apply its own producers' entries under its own field manager without touching another node's. Nothing reads these fields yet: a router still treats every endpoint as Single. The generated API reference also picks up a ServiceRouteAuthorization description that main had not regenerated. Related to #1086 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks
privateip
marked this pull request as ready for review
October 25, 2026 15:37
Contributor
Author
|
Two independent reviews ran on head 0fca054, and both returned merge with no blocker or warning on this PR's code.
CI is green on this head, including the root and end-to-end jobs. This is the bottom of stack #1096. The stack merges as a whole into main with |
3 tasks
ecv
approved these changes
Oct 25, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
Additive, API-only change. Existing ServiceEndpoints (no distribution, no healthCheck) still validate, and no controller code reads the new fields yet, so single-producer behavior is unchanged.
- Both new CEL rules pass for an object with neither field: the Spread/healthCheck pairing evaluates
false == false, and the udp-port rule short-circuits on!has(self.healthCheck).spec.protocolis required, soself.protocol == 'tcp'cannot hit a missing key. The envtest covers the single-default, single, spread, mismatch, udp-no-port and unknown-enum cases. distributionhas no CRD default, so stored objects stay unchanged and "Single" is a code-side default. Fine, but the consumer must treat empty as Single.- Enabling the
statussubresource on an existing CRD is safe: no served-version change, no conversion, and existing objects just gain an empty status. After the CRD applies, a spec update no longer writesstatus, which is fine since nothing wrote it before. - Nested defaults (interval 5, timeout 2, thresholds 3) are applied before the
timeoutSeconds <= intervalSecondsrule, so omitted values validate.
Follow-ups:
config/galactic-router/rbac.yamlgrants only get/list/watch onserviceendpoints. The node-side writer needsserviceendpoints/statuspatch (server-side apply) in the consumer PR, or the first Spread endpoint will fail silently on 403.- "Single allows one ready producer per node and VPC; an endpoint that selects more is refused" documents refusal behavior. Confirm the router already enforces this today, otherwise the doc claims behavior this PR does not deliver.
status.producersis capped at 4096 but nothing ties it to 16 per node times node count. Large fleets could exceed it; worth a sizing note.- The comment on
ServiceEndpointHealthCheckhas one overlong, unwrapped line ("...stays Unknown. A probe succeeds ..."); tidy when next touched.
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A private service endpoint can have only one ready producer per node and VPC, so a service that runs several replicas per node needs one consumer address per replica.
This adds an opt-in spread setting with a required TCP health check, and a status list in which each node reports the health of its own producers.
Nothing reads the new fields yet, so every endpoint behaves as it does today. The generated API reference also picks up a policy description that main had not regenerated.
Test plan
First of three. Next is the datapath in #1093, then the router in #1094.
Fixes #1086
🤖 Generated with Claude Code