Skip to content

feature: implement the ListenerSets experimental API#7998

Merged
zhaohuabing merged 38 commits intoenvoyproxy:mainfrom
zhaohuabing:feat-5323
Jan 29, 2026
Merged

feature: implement the ListenerSets experimental API#7998
zhaohuabing merged 38 commits intoenvoyproxy:mainfrom
zhaohuabing:feat-5323

Conversation

@zhaohuabing
Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing commented Jan 20, 2026

This PR implements the experimental XListenerSet API, as proposed in GEP-1713, allowing listeners to be defined in a separate resource and attached to a Gateway. This feature is enabled via the XListenerSet feature flag in the EnvoyGateway configuration.

Changes

  • New controller logic is added to watch and process XListenerSet resources.
  • XListenerSet resources are attached to a parent Gateway, and their listeners are processed and merged with the Gateway's own listeners.
  • The status of the XListenerSet and its listeners is updated to reflect whether they have been accepted and programmed.
  • RBAC: New RBAC permissions for xlistenersets and xlistenersets/status have been added to the Helm charts and config/rbac/role.yaml.
  • Testing: Unit tests and End-to-end tests have been added to validate XListenerSet functionality for HTTPRoute(HTTP and HTTPS), gRPCRoute, TLSRoute, TCPRoute and UDPRoute.

TODOs

  • Support XListenerSet as TargetRef for xPolicies.
  • Add attached XListenerSets to the Gateway status - depend on the next Gateway API release.

To keep this PR focused, these TODOs will be tracked in separate issues and implemented in follow-up PRs.

implement: #5323
release note: yes

@zhaohuabing zhaohuabing requested a review from a team as a code owner January 20, 2026 12:17
@zhaohuabing zhaohuabing marked this pull request as draft January 20, 2026 12:17
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 20, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 3fe28d7
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/697aa091b53b6f0008ec57b8
😎 Deploy Preview https://deploy-preview-7998--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.

@zhaohuabing zhaohuabing added this to the v1.7.0-rc.1 Release milestone Jan 20, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 58.16464% with 310 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.69%. Comparing base (8452270) to head (3fe28d7).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
internal/provider/kubernetes/routes.go 42.08% 118 Missing and 32 partials ⚠️
internal/provider/kubernetes/controller.go 40.25% 39 Missing and 7 partials ⚠️
internal/provider/kubernetes/indexers.go 51.13% 34 Missing and 9 partials ⚠️
internal/gatewayapi/xlistenerset.go 81.73% 16 Missing and 5 partials ⚠️
internal/provider/kubernetes/status.go 19.23% 20 Missing and 1 partial ⚠️
internal/gatewayapi/runner/runner.go 5.55% 14 Missing and 3 partials ⚠️
internal/gatewayapi/resource/resource.go 14.28% 5 Missing and 1 partial ⚠️
internal/gatewayapi/validate.go 88.46% 3 Missing ⚠️
api/v1alpha1/envoygateway_helpers.go 0.00% 1 Missing ⚠️
internal/gatewayapi/helpers.go 96.77% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7998      +/-   ##
==========================================
- Coverage   73.84%   73.69%   -0.15%     
==========================================
  Files         237      239       +2     
  Lines       35847    36311     +464     
==========================================
+ Hits        26471    26760     +289     
- Misses       7512     7660     +148     
- Partials     1864     1891      +27     

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

@zhaohuabing zhaohuabing force-pushed the feat-5323 branch 7 times, most recently from bf1ce64 to 9811829 Compare January 22, 2026 04:23
@zhaohuabing zhaohuabing marked this pull request as ready for review January 22, 2026 05:10
@jukie
Copy link
Copy Markdown
Contributor

jukie commented Jan 22, 2026

Support XListenerSet as TargetRef for xPolicies.
Support XListenerSet as ParentRef for TCPRoute, TLSRoute, and UDPRoute.

Should we include extra status handling to communicate lack of support for these?

Edit: SupportedKinds is probably good enough

@zhaohuabing zhaohuabing force-pushed the feat-5323 branch 4 times, most recently from cc3858a to 115ca97 Compare January 23, 2026 07:05
@zhaohuabing
Copy link
Copy Markdown
Member Author

zhaohuabing commented Jan 23, 2026

Support XListenerSet as TargetRef for xPolicies.
Support XListenerSet as ParentRef for TCPRoute, TLSRoute, and UDPRoute.

Should we include extra status handling to communicate lack of support for these?

Edit: SupportedKinds is probably good enough

Added support to all the other route types in this PR.

@zhaohuabing zhaohuabing marked this pull request as draft January 23, 2026 08:35
@zhaohuabing zhaohuabing requested review from a team and jukie January 23, 2026 10:08
@zhaohuabing zhaohuabing marked this pull request as ready for review January 23, 2026 10:08

// Drop Status to reduce memory
xls.Status = gwapixv1a1.ListenerSetStatus{}
resourceMap.allAssociatedNamespaces.Insert(xls.Namespace)
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.

we should insert in the resoureTree only when it doesnt exist in the resourceMap, this is what we've done for other resources afaik

Copy link
Copy Markdown
Member Author

@zhaohuabing zhaohuabing Jan 26, 2026

Choose a reason for hiding this comment

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

It returns early at line 1879 to avoid unnecessary processing.

line 1879

		if resourceMap.allAssociatedXListenerSets.Has(key) {
			continue
		}
		
		for _, listener := range xls.Spec.Listeners {
		   ....

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.

ah thanks

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Copy link
Copy Markdown
Contributor

@arkodg arkodg 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

@arkodg arkodg requested review from a team January 28, 2026 06:09
@jukie
Copy link
Copy Markdown
Contributor

jukie commented Jan 28, 2026

/retest

@kkk777-7
Copy link
Copy Markdown
Member

LGTM, thanks Great work!

@jukie
Copy link
Copy Markdown
Contributor

jukie commented Jan 28, 2026

Can we make the e2e's more reliable?

@jukie
Copy link
Copy Markdown
Contributor

jukie commented Jan 28, 2026

/retest

Copy link
Copy Markdown
Contributor

@jukie jukie 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, we can improve the E2Es before full release

@zhaohuabing zhaohuabing merged commit ea1a322 into envoyproxy:main Jan 29, 2026
86 of 92 checks passed
@zhaohuabing zhaohuabing deleted the feat-5323 branch January 29, 2026 01:40
SadmiB pushed a commit to SadmiB/gateway that referenced this pull request Jan 30, 2026
* implement XListenerSet

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add e2e test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* update status

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add debug info

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix routes

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix lint

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* support GRPCRoute

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add https test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix https test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* update provider

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* update e2e

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* update gateway api translator

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* simplify status udpate

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* update xlistenerset status

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* update release note

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* remove debugging log

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* rename API

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add gateway api test for UDPRoute, TCPRoute, and TLSRoute

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* feat(kubernetes): add XListenerSet support for TCPRoute, TLSRoute, and UDPRoute

fix lint

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

fix test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

add TCPRoute test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add udp test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* polish code

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix lint

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add tls test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add debug info

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add debug info

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add debug info

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix tls route

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* remove debugging log

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fixt test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix gateway name extraction logic

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add test for no matching section

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* address comments

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix gen

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

---------

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
@norman-zon norman-zon mentioned this pull request Mar 4, 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