Skip to content

feat: bandwidth limit#8862

Merged
zhaohuabing merged 3 commits intoenvoyproxy:mainfrom
kkk777-7:feat-bandwidth
Apr 28, 2026
Merged

feat: bandwidth limit#8862
zhaohuabing merged 3 commits intoenvoyproxy:mainfrom
kkk777-7:feat-bandwidth

Conversation

@kkk777-7
Copy link
Copy Markdown
Member

@kkk777-7 kkk777-7 commented Apr 26, 2026

What this PR does / why we need it:
Implemented bandwidth limit. follow-up #8630

envoy related document: https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/bandwidth_limit/v3/bandwidth_limit.proto#envoy-v3-api-msg-extensions-filters-http-bandwidth-limit-v3-bandwidthlimit

Which issue(s) this PR fixes:

Fixes #4328

Release Notes: Yes

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 26, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit d897c15
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69f03a647ce04b00085c8b4d
😎 Deploy Preview https://deploy-preview-8862--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kkk777-7
Copy link
Copy Markdown
Member Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01117b8c50

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/xds/translator/bandwidth_limit.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 75.53957% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.35%. Comparing base (6b8ac52) to head (d897c15).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/bandwidth_limit.go 76.74% 11 Missing and 9 partials ⚠️
internal/gatewayapi/backendtrafficpolicy.go 71.42% 8 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8862      +/-   ##
==========================================
- Coverage   74.37%   74.35%   -0.02%     
==========================================
  Files         246      247       +1     
  Lines       39292    39429     +137     
==========================================
+ Hits        29222    29316      +94     
- Misses       8040     8065      +25     
- Partials     2030     2048      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kkk777-7 kkk777-7 force-pushed the feat-bandwidth branch 2 times, most recently from e933dd5 to 45fa6c6 Compare April 26, 2026 08:01
@kkk777-7
Copy link
Copy Markdown
Member Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45fa6c6a39

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/gatewayapi/backendtrafficpolicy.go
Comment thread internal/xds/translator/httpfilters.go
@kkk777-7
Copy link
Copy Markdown
Member Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 522f861d4b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/gatewayapi/backendtrafficpolicy.go
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@kkk777-7 kkk777-7 changed the title Feat bandwidth feat: bandwidth limit Apr 26, 2026
@kkk777-7 kkk777-7 marked this pull request as ready for review April 26, 2026 14:35
@kkk777-7 kkk777-7 requested a review from a team as a code owner April 26, 2026 14:35
@kkk777-7 kkk777-7 added this to the v1.8.0-rc.1 Release milestone Apr 26, 2026
Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

This finding is reported by codex, is it true?

Now that bandwidthLimit is no longer hidden, users can set response.responseTrailers.prefix to strings containing \n, \r, or NUL. The Envoy BandwidthLimit proto rejects response_trailer_prefix unless it matches ^[^\\x00\\n\\r]*$, but the CRD currently accepts the value and buildBandwidthLimit copies it straight into xDS. That can make an accepted BackendTrafficPolicy produce invalid xDS instead of being rejected at admission or translated into a policy status error. Add the same kubebuilder/CEL validation here and cover it in test/cel-validation

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@kkk777-7
Copy link
Copy Markdown
Member Author

@zhaohuabing
thanks, good catch! I think it's true.
I've confirmed envoy api and protoc-gen-validate.

I've added CRD validation and cel-test.

@zhaohuabing
Copy link
Copy Markdown
Member

/retest

zhaohuabing
zhaohuabing previously approved these changes Apr 28, 2026
Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

Signed-off-by: Isaac Wilson <isaac.wilson514@gmail.com>
@jukie jukie requested a review from zhaohuabing April 28, 2026 04:41
@zhaohuabing
Copy link
Copy Markdown
Member

/retest

@zhaohuabing zhaohuabing merged commit 6774309 into envoyproxy:main Apr 28, 2026
65 of 68 checks passed
kkk777-7 added a commit to kkk777-7/gateway that referenced this pull request Apr 30, 2026
* feat: bandwidth limit

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* add: crd validation

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

---------

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
skos-ninja pushed a commit to skos-ninja/envoy-gateway that referenced this pull request May 1, 2026
* feat: bandwidth limit

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* add: crd validation

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

---------

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: Jake Oliver <jake@truelayer.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support BandwidthLimiting

3 participants