Skip to content

api: add HTTP/3 advertised port to ClientTrafficPolicy - #9855

Open
iamhaseebn wants to merge 6 commits into
envoyproxy:mainfrom
iamhaseebn:feat/http3-alt-svc-port
Open

api: add HTTP/3 advertised port to ClientTrafficPolicy#9855
iamhaseebn wants to merge 6 commits into
envoyproxy:mainfrom
iamhaseebn:feat/http3-alt-svc-port

Conversation

@iamhaseebn

Copy link
Copy Markdown

What this PR does / why we need it:

When Envoy Gateway runs behind an external load balancer, the client-facing HTTP/3 port can differ from the Gateway listener port. The generated alt-svc header currently always uses the listener's external port, so clients can be directed to the wrong port.

This adds an optional spec.http3.advertisedPort field to ClientTrafficPolicy. When set, it overrides only the port advertised in the generated alt-svc header. The listener and Service ports remain unchanged. When omitted, the existing behavior is preserved.

The field uses gatewayv1.PortNumber with admission validation for ports 1 through 65535. The value is carried through the infrastructure and xDS IR. The change also updates the generated CRDs and API reference, HTTP/3 documentation, release notes, and regression coverage for both the override and fallback paths.

Verified with:

  • make gen-check
  • make lint
  • go test -p=2 -race ./...
  • make go.test.coverage GO_TEST_COVERAGE_ARGS='--tags=integration,conformance_unit_test -race -p=2'
  • make go.test.cel
  • make lint.markdown licensecheck

Which issue(s) this PR fixes:

Fixes #9721


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

Signed-off-by: Haseeb Nazir <36381672+iamhaseebn@users.noreply.github.com>
@iamhaseebn
iamhaseebn requested a review from a team as a code owner August 26, 2026 17:55
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

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

@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: 95b1ce7bf3

ℹ️ 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/translator.go Outdated
Comment on lines +648 to +649
if http3Settings.AdvertisedPort != nil {
advertisedPort = *http3Settings.AdvertisedPort

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve each listener's advertised HTTP/3 port

When HTTPS listeners share an address and internal port but have section-targeted ClientTrafficPolicies with different advertisedPort values, http3EnabledListeners retains only the last listener's settings for that address/port. Reading the override from that shared value therefore emits the same alt-svc port for every listener's routes, directing clients for at least one listener to the wrong external port. Keep enablement shared, but select the override from the current httpListener.HTTP3 settings.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in ef6758f. Shared address/port state now tracks only HTTP/3 enablement, while the alt-svc override comes from the current listener. The xDS golden fixture now covers distinct advertised ports on listeners sharing the same address and port.

Signed-off-by: Haseeb Nazir <36381672+iamhaseebn@users.noreply.github.com>
Signed-off-by: Haseeb Nazir <36381672+iamhaseebn@users.noreply.github.com>
@iamhaseebn

Copy link
Copy Markdown
Author

@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: ef6758f205

ℹ️ 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 api/v1alpha1/clienttrafficpolicy_types.go
@zirain zirain added this to the v1.10.0-rc.1 Release milestone Aug 27, 2026
@arkodg

arkodg commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

LGTM thanks
can the existing e2e in test/e2e/tests/http3.go be enhanced to also update this port

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.28%. Comparing base (3cb03be) to head (e369dc5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9855      +/-   ##
==========================================
- Coverage   81.31%   81.28%   -0.03%     
==========================================
  Files         263      263              
  Lines       40870    40874       +4     
==========================================
- Hits        33233    33226       -7     
- Misses       7637     7648      +11     

☔ View full report in Codecov by Harness.
📢 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.

Signed-off-by: Haseeb Nazir <36381672+iamhaseebn@users.noreply.github.com>
Signed-off-by: Haseeb Nazir <36381672+iamhaseebn@users.noreply.github.com>
Signed-off-by: Haseeb Nazir <36381672+iamhaseebn@users.noreply.github.com>
@zirain

zirain commented Sep 3, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: e369dc569b

ℹ️ 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".

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.

QUIC listener always announce Gateway port in alt-svc and there is no way to configure it

3 participants