Skip to content

GEP-5224: Pre-Routing Filters (provisional)- #5224 - #5235

Merged
kubernetes-prow[bot] merged 4 commits into
kubernetes-sigs:mainfrom
jaellio:jaellio/pre-routing
Sep 11, 2026
Merged

kubernetes-prow[bot] merged 4 commits into
kubernetes-sigs:mainfrom
jaellio:jaellio/pre-routing

Conversation

@jaellio

@jaellio jaellio commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind gep

What this PR does / why we need it:

Defines the provision GEP for pre-routing

Which issue(s) this PR fixes:

Fixes #5224

Does this PR introduce a user-facing change?:

NONE

Was AI used in preparing this PR?

AI was used to help write this GEP but the GEP was reviewed and edited by me.

- needs revision before review

Signed-off-by: Jackie Elliott <jaellio@microsoft.com>
Signed-off-by: Jackie Elliott <jaellio@microsoft.com>
@kubernetes-prow kubernetes-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. kind/gep PRs related to Gateway Enhancement Proposal(GEP) do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 9, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @jaellio. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 9, 2026
@jaellio jaellio changed the title GEP-5224: Pre-Routing (provisional)- #5224 GEP-5224: Pre-Routing Filters (provisional)- #5224 Sep 9, 2026

@robscott robscott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @jaellio!

Comment thread geps/gep-5224/index.md

> "Filters define the filters that are applied to requests that match this
> rule."
> β€” `HTTPRouteRule.Filters`, [apis/v1/httproute_types.go](../../apis/v1/httproute_types.go)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we want to optimize for people that read via website, I'd recommend linking to reference docs instead of a relative link like this

Comment thread geps/gep-5224/index.md
Comment on lines +138 to +140
**pre-routing filters**, processing that runs before route selection and may
influence it, and that this belongs in the Gateway API family of APIs rather
than only in implementation-specific extensions or out-of-band components.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a blocker for this PR, but something we'll need to figure out as we define the API:

Is this attached after any request matching? IE technically Gateway Listeners match requests on port, protocol, and hostname. Presumably, some pre-routing filters could modify any of those attributes of a request. If that's so, I think we'd be left with several options:

  1. Consider an attachment point above listener
  2. Consider ways that we could consider some of these request attributes immutable
  3. Allow mutation but note that it does not affect listener matching
  4. Allow mutation and reprocess listener matching after each filter

To be clear, this does not need to be solved in this PR, just starting the discussion in advance of the next PR since we're trying to move quickly here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tend to favor putting this config at the Listener level.

That has the advantage that we can assume the protocol has already matched, and define what filters work by protocol rather than in some other way. If we put prerouting filters above listener (that is, option 1), then the definition will need to reference what protocols it's valid for anyway (since HTTP filters will only be valid for UDP traffic if that traffic is also QUIC/HTTP3, for example).

But agreed, this should be part of the discussion around API design once we merge this step.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also lets you filter by hostname. Not sure how that interacts with some of our "hostname intersection" discussions though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or put it the opposite way - if we cannot let it filter by hostname on the listener, it cannot attach to listener, since then it would not be functioning correctly. So hopefully it can since there are some very nice properties to match on listener! This is how we do it in AGW fwiw

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 10, 2026
@robscott

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 10, 2026
Comment thread geps/gep-5224/index.md
Comment on lines +158 to +161
* **Selecting a concrete API shape.** Whether pre-routing filters attach at the
`Gateway` level, the listener level, via a new construct on `HTTPRoute`, via
policy attachment, or some combination, is deferred. See
[Options Under Consideration](#options-under-consideration).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is fine for Provisional, but we will need to remove this almost immediately if we want to make the Experimental cutoff for v1.7 (which I think we should be aiming for!).

@youngnick

Copy link
Copy Markdown
Contributor

This LGTM for provisional with the one exception that it needs a filled out metadata.yaml file. I'm working on some ideas about how that data is going to be used, but I need it there for them to work. πŸ˜„

@youngnick

Copy link
Copy Markdown
Contributor

/ok-to-test

Signed-off-by: Jackie Elliott <jaellio@microsoft.com>
@jaellio

jaellio commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

This LGTM for provisional with the one exception that it needs a filled out metadata.yaml file. I'm working on some ideas about how that data is going to be used, but I need it there for them to work. πŸ˜„

@youngnick Updated!

@robscott robscott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @jaellio! One last nit, otherwise LGTM.

/label ail/2

Comment thread geps/gep-5224/metadata.yaml Outdated
Comment on lines +10 to +11
featureNames:
- PayloadProcessor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Recommend a different feature name for this such as PreRoutingFilters.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@robscott Fixed - copy pasta

@kubernetes-prow kubernetes-prow Bot added the ail/2 Categorizes a PR as having AI Influence Level 2 (major AI augmentation) label Sep 11, 2026
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaellio, robscott

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Jackie Elliott <jaellio@microsoft.com>
@robscott

Copy link
Copy Markdown
Member

/lgtm
/hold cancel

@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 11, 2026
@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit bc55309 into kubernetes-sigs:main Sep 11, 2026
8 checks passed

@nirrozenbaum nirrozenbaum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

joining the party late (was on a holiday vacation).
/lgtm

left one comment which I think should be a guiding principle (prefer reuse over new primitives when possible).

Comment thread geps/gep-5224/index.md
answer to the pre-routing portion of [#5194](https://github.com/kubernetes-sigs/gateway-api/issues/5194).
* Enumerate the API-shape and semantic decisions that must be resolved at the
Experimental stage, without committing to any of them here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would also add as a goal - prefer reusing/extending the existing filters over creating new filters., e.g., it would make sense to me to extend RequestHeaderModifier and allow it to set a header based on a value from the body, rather than inventing a new filter for this option.

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

Labels

ail/2 Categorizes a PR as having AI Influence Level 2 (major AI augmentation) approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/gep PRs related to Gateway Enhancement Proposal(GEP) lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GEP: Pre-Routing

5 participants