← Back to Pull requests

docs: explain upstream protocol selection in BackendTrafficPolicy concept page #10732

Open
MaxonT opened this pull request with 10 lines diff across 1 files
View on GitHub
MaxonT MaxonT commented on Nov 29, 2026 23:54 UTC
Author

This adds a docs section on backend protocol selection, which is what issue #8773 asks for, and I haven't changed any code in the gateway itself.

Fixes #8773

The BackendTrafficPolicy concept page documents targeting and merging, but not how Envoy Gateway picks the HTTP protocol towards a backend, which is what the issue asks for. This adds an "Upstream Protocol Selection" section that covers:

appProtocol: kubernetes.io/h2c on a Service port, or gateway.envoyproxy.io/h2c in a Backend's appProtocols, for HTTPRoute backends,
GRPCRoute backends (and the grpc appProtocol on an HTTPRoute backend), and

  • useClientProtocol, which follows the client's protocol,
  • and states that the http2 field only tunes HTTP/2 settings and does not enable HTTP/2, as @arkodg described in #8648.

    I checked each statement against internal/gatewayapi/route.go (resolveBackendProtocol, inspectAppProtocolByRouteKind), internal/xds/translator/cluster.go (useClientProtocol, requiresHTTP2Options) and the field comment in api/v1alpha1/backendtrafficpolicy_types.go. I left out the BackendTLSPolicy and ALPN route that was mentioned in #8648, because I could not confirm it from the code. #9574 attempted the same topic and was closed as stale; this is a smaller section on the same page.

    Only site/content/en/latest/concepts/gateway_api_extensions/backend-traffic-policy.md changes (docs only, no API or behaviour change).

    Checks

    markdownlint-cli with .github/markdown_lint_config.json exits 0 on the changed file. Not run: the docs site build, a live cluster, and the repository CI on this head. The commit is signed off (DCO).

    Diff: 10 lines (+10 / -0) across 1 files Reviewer: zirain Review duration: 2517m
    All Vouch review confidence checks passed
    Residual risk 0.04 = Change Risk (0.17) × (1 − Review Confidence (0.79)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.17 · 10 lines diff across 1 files
    0.17
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.75 · 5 substantive comment(s)
    0.75
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    78%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.143
    Real PR Conversation Timeline
    10 items
    netlify[bot] netlify[bot] commented on Nov 29, 2026 23:54 UTC
    Bot

    <span aria-hidden="true">✅</span> Deploy Preview for cerulean-figolla-1f9435 ready!


    Built without sensitive environment variables

    | Name | Link |
    |:-:|------------------------|
    |<span aria-hidden="true">🔨</span> Latest commit | 3212580d053c7d60ec0e33519c03ec1174fbbb83 |
    |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6b0cd150139c6b4cec6451e5 |
    |<span aria-hidden="true">😎</span> Deploy Preview | https://deploy-preview-10732--cerulean-figolla-1f9435.netlify.app |
    |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />!QR Code<br /><br />_Use your smartphone camera to open QR code link._</details> |
    ---
    <!-- cerulean-figolla-1f9435 Preview -->
    _To edit notification comments on pull requests, go to your Netlify project configuration._

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 29, 2026 23:54 UTC
    Bot

    <!-- codex-pull-request-review-summary -->
    <!-- codex-review-state:v1 {"code_review":{"commit_sha":"3212580d053c7d60ec0e33519c03ec1174fbbb83","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->

    <details>
    <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>

    This comment shows the latest Codex review activity on this pull request.

    | Review | Status | Commit | Review trigger |
    | --- | --- | --- | --- |
    | 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-30T01:30:23.170844Z">2026-11-30T01:30:23.170844Z</relative-time> | 3212580 | New commits |

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    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" or "@codex security review".
  • Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    </details>

    </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Nov 29, 2026 23:56 UTC
    Code Review
    site/content/en/latest/concepts/gateway_api_extensions/backend-traffic-policy.md:1
    @@ -244,6 +244,16 @@ In this example, the route-level policy merges with the gateway-level policy, re
     - When `mergeType` is unset, no merging occurs - only the most specific policy takes effect
     - The merged configuration combines both policies, enabling layered protection strategies
     
    +## Upstream Protocol Selection
    +
    +Envoy Gateway chooses the HTTP protocol it uses towards a backend from the backend and the route, not from the `http2` field of `BackendTrafficPolicy`. A backend uses HTTP/2 when one of the following applies:
    +
    +- The Kubernetes Service port sets `appProtocol: kubernetes.io/h2c`, or a `Backend` resource lists `gateway.envoyproxy.io/h2c` in `appProtocols`. This applies to `HTTPRoute` backends.
    +- The route is a `GRPCRoute`, whose backends are treated as gRPC. An `HTTPRoute` backend whose `appProtocol` is `grpc` is treated as gRPC as well.
    +- `useClientProtocol` is set to `true`, which makes Envoy send requests to the backend with the same HTTP protocol the client used. This overrides the protocol indicated by the backend.

    <sub><sub>!P2 Badge</sub></sub> Qualify protocol mirroring for HTTP/3 clients

    When a Gateway accepts HTTP/3, useClientProtocol: true does not preserve that protocol upstream. The flag's branch in buildTypedExtensionProtocolOptions supplies only HTTP/1 and HTTP/2 options (internal/xds/translator/cluster.go:1372–1377), while upstream HTTP/3 requires separate http3 configuration that is explicitly incompatible with this flag (internal/ir/xds.go:2478–2481). The unqualified “same HTTP protocol” guidance can therefore lead users to select this flag for an HTTP/3-only backend and encounter upstream failures. Qualify the mirroring guarantee and mention the HTTP/3 exception.

    Useful? React with 👍 / 👎.

    <!-- codex-code-review-finding:v1 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 29, 2026 23:56 UTC
    Reviewer

    <!-- codex-review-receipt:v1 -->

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: 1c07b89d0a

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

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

    </details>

    MaxonT MaxonT commented on Nov 30, 2026 01:29 UTC
    Author

    Correction to the description: the useClientProtocol bullet was inaccurate for HTTP/3. The automated review was right that it only covers HTTP/1 and HTTP/2 clients. In 3212580 the bullet now says an HTTP/3 client is not forwarded over HTTP/3, and that useClientProtocol cannot be used together with http3. This is still a docs-only change. I haven't run the site build or a live HTTP/3 request, and CI on the new head is still pending.

    MaxonT MaxonT commented on Nov 30, 2026 03:02 UTC
    Author

    Hi team, could you please review this when you have a moment?

    In short: Explain upstream protocol selection in BackendTrafficPolicy concept page.

    I think this will be really valuable. You may want to take a look. Thanks!

    MaxonT MaxonT commented on Nov 30, 2026 19:11 UTC
    Author

    Hi team, could you please review this when you have a moment?

    In short: Explain upstream protocol selection in BackendTrafficPolicy concept page.

    I think this will be really valuable. You may want to take a look. Thanks!

    MaxonT MaxonT commented on Dec 01, 2026 01:33 UTC
    Author

    Hi @zirain, @zhaohuabing, could you please review this when you have a moment?

    In short: Explain upstream protocol selection in BackendTrafficPolicy concept page.

    I think this will be really valuable. You may want to take a look. Thanks!

    zirain zirain approved these changes on Dec 01, 2026 01:34 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    MaxonT MaxonT
    Labels
    risk: low confidence: 78.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 17.3% (LOW) · Higher = larger blast radius
    17.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 78.6% · Lower = rushed or shallow review
    78.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3.7% · Safe to merge
    3.7%