Skip to content

refactor: move envoy subset filter to a screener plugin - #2334

Open
elevran wants to merge 2 commits into
llm-d:mainfrom
elevran:worktree-envoy-subset-screener-plugin
Open

refactor: move envoy subset filter to a screener plugin#2334
elevran wants to merge 2 commits into
llm-d:mainfrom
elevran:worktree-envoy-subset-screener-plugin

Conversation

@elevran

@elevran elevran commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The envoy subset filter (envoy.lb.subset_hint / x-gateway-destination-endpoint-subset) was hardcoded in DatastoreEndpointCandidates.Locate. This refactor moves it into a request-control Screener plugin (pkg/epp/framework/plugins/requestcontrol/screener/envoysubset) and registers it as a system built-in from the runner, gated only by the existing --disable-endpoint-subset-filter CLI flag. No config-file knob is added, so the user cannot enable it in two places at once.

DatastoreEndpointCandidates and CachedEndpointCandidates now always return the full pod set; the cache key is no longer metadata-dependent. InferenceRequest gains a Metadata field that carries the Envoy dynamic-metadata map from envoy.ExtractMetadataValues to the screener, mirroring how Headers already flows.

The --disable-endpoint-subset-filter CLI flag is the single switch. Behavior is unchanged.

Which issue(s) this PR fixes:

NA. Cleanup following the introduction of endpoint screening plugins.

Release note (write NONE if no user-facing change):

NONE

New tests in pkg/epp/framework/plugins/requestcontrol/screener/envoysubset/plugin_test.go cover the screener
Updated tests in pkg/epp/requestcontrol/candidates_test.go cover the simplified Locate and cache-key behavior

The envoy.lb.subset_hint / x-gateway-destination-endpoint-subset handling
was hardcoded in DatastoreEndpointCandidates.Locate. Promote it to a
request-control Screener (pkg/epp/framework/plugins/requestcontrol/screener/envoysubset)
registered as a system built-in by the runner, gated only by the existing
--disable-endpoint-subset-filter CLI flag. No config-file knob is added,
so the user cannot enable it in two places at once.

DatastoreEndpointCandidates and CachedEndpointCandidates now always
return the full pod set; the cached path no longer varies its key by
request metadata. InferenceRequest gains a Metadata field that carries
the Envoy dynamic-metadata map from extractMetadataValues to the
screener, matching how Headers already flows.

Signed-off-by: Etai Lev Ran <elevran@gmail.com>
@elevran
elevran requested a review from a team as a code owner August 9, 2026 11:34
@elevran
elevran requested review from ahg-g and vMaroon August 9, 2026 11:34
@github-actions github-actions Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. kind/cleanup labels Aug 9, 2026
The hermetic integration tests assert the exact ServiceUnavailable
message text. With the envoysubset screener now responsible for the
empty-result case (when the subset filter matches nothing), the
director must emit the same "failed to find endpoint candidates for
serving the request" message the old Locate path produced, so the
existing test expectations keep holding.

Signed-off-by: Etai Lev Ran <elevran@gmail.com>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure if this is an envoy specific feature or any GAIE compliant gateway supports it.
Can rename path from envoysubset to gwsubset (or similar)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant