allow setting per connection buffer limit on Gateway with annotation - #11505
Merged
puertomontt merged 1 commit intoJun 27, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for a new annotation (kgateway.dev/per-connection-buffer-limit) that sets a per-connection buffer limit on Gateway listeners. Key changes include:
- Adding
PerConnectionBufferLimitBytesfields to IR structs and backend Gateway representation - Parsing the annotation into a
uint32in the KRT indexer - Propagating the limit into Envoy listener configs via the IR translator
- Adding an end-to-end translator test for the new feature
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/pluginsdk/ir/gw2.go | Added PerConnectionBufferLimitBytes to ListenerIR and GatewayIR |
| pkg/pluginsdk/ir/backend.go | Added PerConnectionBufferLimitBytes to backend Gateway IR |
| internal/kgateway/translator/irtranslator/gateway.go | Populating listener’s PerConnectionBufferLimitBytes in Envoy config |
| internal/kgateway/translator/gateway_translator.go | Mapping limit on translator output |
| internal/kgateway/krtcollections/policy.go | Parsing annotation into uint32 and attaching to Gateway IR |
| api/annotations/gateway.go | Declared annotation constant |
| internal/kgateway/translator/gateway/gateway_translator_test.go | Added translator test case for per-connection buffer limit |
Comments suppressed due to low confidence (1)
internal/kgateway/translator/gateway/gateway_translator.go:87
- The per-connection buffer limit is being applied at the gateway level here, but it should be applied per listener. Remove or relocate this field mapping and ensure it’s set individually on each listener in
Translate.
PerConnectionBufferLimitBytes: gateway.PerConnectionBufferLimitBytes, // wrong place???
puertomontt
force-pushed
the
perconnbufflim-gateway
branch
from
June 27, 2025 04:38
0056d29 to
2ab9bb0
Compare
Signed-off-by: omar <omar.hammami@solo.io>
puertomontt
force-pushed
the
perconnbufflim-gateway
branch
from
June 27, 2025 04:46
2ab9bb0 to
3c277b6
Compare
shashankram
approved these changes
Jun 27, 2025
timflannagan
approved these changes
Jun 27, 2025
Contributor
|
design doc: #11515 |
Closed
3 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.
Description
#11387
Allow setting listener-level perConnectionBufferLimitBytes.
Change Type
/kind new_feature
Changelog
Additional Notes
We discussed several options for setting perConnectionBufferLimitBytes.
We decided using an annotation on the gateway made sense and was straightforward to implement.