Skip to content

feat: add admission control to BackendTrafficPolicy - #8872

Merged
jukie merged 34 commits into
envoyproxy:mainfrom
jukie:admission-control
Apr 30, 2026
Merged

feat: add admission control to BackendTrafficPolicy#8872
jukie merged 34 commits into
envoyproxy:mainfrom
jukie:admission-control

Conversation

@jukie

@jukie jukie commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

This carries forward #7529 from @aburan28

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.

Release Notes: Yes

aburan28 and others added 26 commits March 30, 2026 14:50
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
- Change SamplingWindow from *metav1.Duration to *gwapiv1.Duration
  to satisfy kube-api-linter (nodurations rule)
- Add parseSamplingWindow converter in gateway API translator to
  convert gwapiv1.Duration to metav1.Duration for the IR
- Fix unused-parameter lint errors in patchRoute and patchResources
  by renaming unused params to _
- Regenerate deepcopy, CRD manifests, helm test outputs, and API docs

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Fix merge conflicts from rebase onto upstream/main, fix missing imports
in admission control tests, and ensure EvaluationCriteria is always set
in the admission control config.

Signed-off-by: Adam Buran <aburan28@gmail.com>
- 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>
…igo lint

Signed-off-by: Adam Buran <aburan28@gmail.com>
…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>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: Adam Buran <aburan28@gmail.com>
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@netlify

netlify Bot commented Apr 27, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

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

@jukie jukie changed the title Admission control feat: add admission control to BackendTrafficPolicy Apr 27, 2026
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie
jukie marked this pull request as ready for review April 27, 2026 22:17
@arkodg
arkodg requested a review from a team April 27, 2026 23:42
Comment thread api/v1alpha1/admission_control.go Outdated
Comment thread api/v1alpha1/admission_control.go Outdated
Comment thread api/v1alpha1/admission_control.go
Comment thread api/v1alpha1/admission_control.go
Comment thread api/v1alpha1/envoyproxy_types.go Outdated
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
jukie and others added 2 commits April 28, 2026 18:29
Signed-off-by: Isaac Wilson <isaac.wilson514@gmail.com>
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
arkodg
arkodg previously approved these changes Apr 29, 2026
@arkodg
arkodg requested review from a team April 29, 2026 04:20
zhaohuabing
zhaohuabing previously approved these changes Apr 29, 2026
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie
jukie dismissed stale reviews from zhaohuabing and arkodg via da89291 April 29, 2026 16:46
jukie and others added 2 commits April 29, 2026 10:54
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie
jukie requested review from a team, arkodg and zhaohuabing April 29, 2026 18:06
@jukie

jukie commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@jukie
jukie merged commit 8fa767a into envoyproxy:main Apr 30, 2026
76 of 82 checks passed
@jukie
jukie deleted the admission-control branch April 30, 2026 05:28
skos-ninja pushed a commit to skos-ninja/envoy-gateway that referenced this pull request May 1, 2026
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.

5 participants