Skip to content

feat: add admission control functionality - #7529

Closed
aburan28 wants to merge 25 commits into
envoyproxy:mainfrom
aburan28:adam--add-admission-control
Closed

feat: add admission control functionality#7529
aburan28 wants to merge 25 commits into
envoyproxy:mainfrom
aburan28:adam--add-admission-control

Conversation

@aburan28

@aburan28 aburan28 commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?

feature

What this PR does / why we need it

This PR adds support for Envoy's Admission Control filter to Envoy Gateway by exposing it through BackendTrafficPolicy.

Admission control probabilistically rejects requests based on the historical success rate of upstream requests within a configurable sliding time window. This provides client-side load shedding for overloaded or degraded backends and complements circuit breaking and retry policies.

Changes include

  • API types: adds AdmissionControl with configurable samplingWindow, successRateThreshold, aggression, rpsThreshold, maxRejectionProbability, and success criteria for HTTP and gRPC.
  • BackendTrafficPolicy API: adds the optional admissionControl field.
  • Gateway API translation: translates admission-control policy config into XDS IR traffic features.
  • XDS translation: configures Envoy's envoy.filters.http.admission_control as an upstream HTTP filter on generated clusters.
  • EnvoyFilter registration: registers envoy.filters.http.admission_control as a known Envoy filter.
  • Generated artifacts: updates CRDs, deepcopy methods, Helm golden output, and API docs.
  • Tests and examples: adds xDS translator coverage, Gateway API testdata, and a Kubernetes example manifest.

Which issue(s) this PR fixes

None linked.

Release Notes

Added admission control support to BackendTrafficPolicy, enabling client-side load shedding based on historical upstream success rates using Envoy's admission control filter.

@aburan28
aburan28 marked this pull request as ready for review November 15, 2025 18:18
@aburan28
aburan28 requested a review from a team as a code owner November 15, 2025 18:18
@codecov

codecov Bot commented Nov 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.61702% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.47%. Comparing base (cab6837) to head (80c8975).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/backendtrafficpolicy.go 93.33% 1 Missing and 1 partial ⚠️
internal/xds/translator/admission_control.go 96.42% 1 Missing and 1 partial ⚠️
internal/xds/translator/cluster.go 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7529      +/-   ##
==========================================
+ Coverage   74.39%   74.47%   +0.07%     
==========================================
  Files         246      247       +1     
  Lines       39221    39314      +93     
==========================================
+ Hits        29180    29280     +100     
+ Misses       8017     8009       -8     
- Partials     2024     2025       +1     

☔ 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.

Comment thread api/v1alpha1/admission_control.go Outdated
@arkodg

arkodg commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

hey @aburan28 you've also raised #7016 for adding adaptive concurrency control support, these are similar options to throttle clients based on server characteristics ( latency, load), would help if you can outline your use case first, so we can prioritize one or the other, and document the reasons for adding support for it

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale label Dec 30, 2025
@netlify

netlify Bot commented Feb 13, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 80c8975
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69eba361782afa000800d351
😎 Deploy Preview https://deploy-preview-7529--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.

@github-actions github-actions Bot removed the stale label Feb 13, 2026
@aburan28
aburan28 force-pushed the adam--add-admission-control branch from 674710b to 9e8be42 Compare February 13, 2026 22:34
@aburan28 aburan28 closed this Feb 14, 2026
@aburan28 aburan28 reopened this Feb 14, 2026
@aburan28

Copy link
Copy Markdown
Contributor Author

hey @aburan28 you've also raised #7016 for adding adaptive concurrency control support, these are similar options to throttle clients based on server characteristics ( latency, load), would help if you can outline your use case first, so we can prioritize one or the other, and document the reasons for adding support for it

IMO, Admission Control and Adaptive Concurrency are complementary, not competing strategies. They address different failure signals and protect backends in different ways. I believe it is useful to include both within Envoy Gateway.

Admission control does have a simpler operational overhead compared to adaptive concurrency. It deals with error rates which users can reason about easily. So for now my focus is on admission control although I do have a PR for adaptive concurrency open as well.

Use cases I have are really to emulate a dynamic circuit breaker that is based off of success/error rate and to protect backends from overload.

@arkodg arkodg added this to the v1.8.0-rc.1 Release milestone Feb 22, 2026
@arkodg
arkodg requested review from a team February 22, 2026 21:50
@arkodg

arkodg commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

hey @aburan28 you've also raised #7016 for adding adaptive concurrency control support, these are similar options to throttle clients based on server characteristics ( latency, load), would help if you can outline your use case first, so we can prioritize one or the other, and document the reasons for adding support for it

IMO, Admission Control and Adaptive Concurrency are complementary, not competing strategies. They address different failure signals and protect backends in different ways. I believe it is useful to include both within Envoy Gateway.

Admission control does have a simpler operational overhead compared to adaptive concurrency. It deals with error rates which users can reason about easily. So for now my focus is on admission control although I do have a PR for adaptive concurrency open as well.

Use cases I have are really to emulate a dynamic circuit breaker that is based off of success/error rate and to protect backends from overload.

sure +1 for Admission Control to solve the dynamic circuit breaker issue

going forward lets start with a GH issue, an API PR and then an implementation PR

for this feature, lets use this PR

Comment thread api/v1alpha1/admission_control.go
Comment thread api/v1alpha1/admission_control.go
Comment thread api/v1alpha1/admission_control.go Outdated
@aburan28
aburan28 force-pushed the adam--add-admission-control branch from b26aea7 to aeb7925 Compare February 28, 2026 23:36
Comment thread api/v1alpha1/admission_control.go Outdated
Comment thread api/v1alpha1/admission_control.go Outdated
@arkodg

arkodg commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

hey @aburan28 can you resolve the mere conflicts

@arkodg
arkodg requested review from a team and zhaohuabing March 7, 2026 22:03
@arkodg

arkodg commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

make gen-check is still failing - can you run make manifests && make generate and commit those changes

arkodg
arkodg previously approved these changes Mar 15, 2026
@arkodg
arkodg self-requested a review March 15, 2026 02:47
- Remove Enabled field (presence of admissionControl implies enabled)
- Switch SuccessRateThreshold, Aggression, MaxRejectionProbability from
  float64 to uint32 to avoid floats in the API layer
- Register envoy.filters.http.admission_control in the EnvoyFilter enum
- Fix example manifest (srThreshold -> successRateThreshold, integer values)
- Regenerate CRDs, deepcopy, docs, and xds translator testdata

Signed-off-by: Adam Buran <aburan28@gmail.com>
Remove stale lbPolicy field from cluster output after main merge.

Signed-off-by: Adam Buran <aburan28@gmail.com>
Regenerates test/helm/gateway-crds-helm/*.out.yaml and
site/content/en/latest/api/extension_types.md to match the current
admission control API (int32 percentages, enabled field removed) and
pick up envoy.filters.http.admission_control in the filter order enum.

Signed-off-by: Adam Buran <aburan28@gmail.com>
…-control

Signed-off-by: Adam Buran <aburan28@gmail.com>
@aburan28
aburan28 force-pushed the adam--add-admission-control branch from 3bd62c4 to 2a8a41a Compare April 17, 2026 03:27
…igo lint

Signed-off-by: Adam Buran <aburan28@gmail.com>
Comment thread internal/xds/translator/httpfilters.go Outdated
@jukie

jukie commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Please add a testdata example under internal/gatewayapi/

Comment thread internal/xds/translator/admission_control.go Outdated
…map, add gatewayapi testdata

- Revert the HCM HTTP filter ordering shifts in newOrderedHTTPFilter; the
  admission_control filter is registered as an upstream cluster filter, so it
  does not need a slot in the downstream HCM ordering.
- Move the gRPC status-code lookup map to a package-level var so it is not
  rebuilt on every translation cycle.
- Add backendtrafficpolicy-admission-control gatewayapi testdata covering both
  gateway-targeted (gRPC success criteria, all knobs set) and route-targeted
  (HTTP success criteria, minimal config) policies.

Signed-off-by: Adam Buran <adam.buran@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
@jukie

jukie commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

@codex review

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

Copy link
Copy Markdown

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: a98b9e2213

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/v1alpha1/backendtrafficpolicy_types.go
Comment thread examples/kubernetes/admission-control.yaml Outdated
Signed-off-by: Adam Buran <aburan28@gmail.com>
Comment thread internal/xds/translator/admission_control.go Outdated
Comment thread internal/gatewayapi/backendtrafficpolicy.go Outdated
Comment thread internal/ir/xds.go
Comment thread internal/ir/xds.go
@jukie

jukie commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jukie

jukie commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for working on this @aburan28. A few nits to fix but besides that LGTM.

@jukie jukie changed the title add admission control functionality feat: add admission control functionality Apr 23, 2026
Signed-off-by: Adam Buran <aburan28@gmail.com>
@jukie
jukie requested review from a team and arkodg April 24, 2026 17:07
@jukie

jukie commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

LGTM thanks!

@jukie

jukie commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

@aburan28 can you fix the conflicts from main and add a release note?

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.

4 participants