Skip to content

EXP: TCPRoute GEP - #4783

Merged
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
zac-nixon:znixon/tcp-route
May 5, 2026
Merged

k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
zac-nixon:znixon/tcp-route

Conversation

@zac-nixon

Copy link
Copy Markdown
Contributor

/kind gep
What this PR does / why we need it:

Backfills TCPRoute GEP

Which issue(s) this PR fixes:

#2644

Does this PR introduce a user-facing change?:

TCPRoute GEP

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/gep PRs related to Gateway Enhancement Proposal(GEP) cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 23, 2026
@k8s-ci-robot
k8s-ci-robot requested review from kflynn and rikatz April 23, 2026 22:39
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 23, 2026
Comment thread geps/gep-2644/index.md Outdated
## TLDR

Gateway API needs a first-class Route type for TCP because a meaningful class of Kubernetes workloads cannot be represented by the standard Gateway API routing model without it.
HTTPRoute only addresses a single class of TCP-based traffic (HTTP/1.1 and HTTP/2 over TCP), leaving the broader universe of TCP workloads without a portable routing API.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe a nit, but a user wanting a full TCP stream but that can rely on encrypted frontend traffic can use TLSRoute. The TCPRoute is intended for folks that cannot solve their needs with HTTP/GRPCRoute nor TLSRoute

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.

Suggested change
HTTPRoute only addresses a single class of TCP-based traffic (HTTP/1.1 and HTTP/2 over TCP), leaving the broader universe of TCP workloads without a portable routing API.
HTTPRoute only addresses a single class of TCP-based traffic (HTTP/1.1 and HTTP/2 over TCP), and TLSRoute handles routing via SNI, leaving the broader universe of TCP workloads that don't work in either of those cases without a portable routing API.

How about this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@zac-nixon this wasn't fixed, was it?

Comment thread geps/gep-2644/index.md Resolved
Comment thread geps/gep-2644/index.md Resolved
Comment thread geps/gep-2644/index.md
- A Gateway has multiple TCP listeners: `postgres` on port 5432 and `kafka` on port 9092
- A TCPRoute specifies a `parentRef` with only the Gateway name (no `sectionName` or `port`)

- The TCPRoute is accepted with the following status:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We may want also to be explicit about the connectivity tests (this can be done on the experimental GEP): what happens when I connect to one or other listener

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.

Yes, as on UDPRoute, I think it may be important to be clear that, when a TCPRoute does this, it effectively multiplexes the Listener ports onto a single port on the backend.

@rikatz rikatz changed the title GEP: Add TCPRoute GEP EXP: TCPRoute GEP Apr 24, 2026
@rikatz rikatz moved this to Needs sponsors in Gateway API - Next Experimental Apr 24, 2026
@kflynn

kflynn commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

I broadly agree with @rikatz's comments here. Looks good otherwise though, I'd just like to see the requested bit of clarification in the goals before landing this.

Comment thread geps/gep-2644/index.md Outdated
Comment on lines +378 to +404
1. TCPRoute with multiple weighted backends distributes connections according to configured weights
- A Gateway has a TCP listener named `kafka` on port 9092
- A TCPRoute specifies a `parentRef` with `sectionName: kafka` and multiple `backendRefs`:
- `kafka-broker-1` with `weight: 70`
- `kafka-broker-2` with `weight: 30`

- The TCPRoute is accepted with the following status:

```
parents:
- parentRef:
group: gateway.networking.k8s.io
kind: Gateway
name: tcp-gateway
sectionName: kafka
conditions:
- type: Accepted
status: "True"
reason: Accepted
- type: ResolvedRefs
status: "True"
reason: ResolvedRefs
```

- TCP connections sent to port 9092 are distributed across backends respecting the configured weights (approximately 70% to `kafka-broker-1` and 30% to `kafka-broker-2`).

Conformance Level: **Core**

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.

It may be important to specify what defines a TCP connection (that is, to say that, yes that means a full TCP connection including everything up until the FIN or RST).

@youngnick

Copy link
Copy Markdown
Contributor

Couple of small things, but aside from that, this LGTM for Provisional, and tbh is pretty close to Experimental anyway.

@zac-nixon
zac-nixon force-pushed the znixon/tcp-route branch from 7d83a9f to b1d542e Compare May 1, 2026 23:28
@zac-nixon

Copy link
Copy Markdown
Contributor Author

Addressed the comments.

@rikatz

rikatz commented May 2, 2026

Copy link
Copy Markdown
Member

@zac-nixon can't see changes from the last commit, seems you missed to push the changes.

Thanks!

@zac-nixon

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread geps/gep-2644/index.md Outdated

- TCP connections sent to port 9092 are distributed across backends respecting the configured weights (approximately 70% to `kafka-broker-1` and 30% to `kafka-broker-2`). In this situation, TCP SYN packets denote one connection for weighting purposes.

Conformance Level: **Core**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this conformance level should be "Extended"

@rikatz

rikatz commented May 4, 2026

Copy link
Copy Markdown
Member

/approve
/hold cancel
one minor change, but lgtm. We can followup on it

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rikatz, zac-nixon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2026
@zac-nixon
zac-nixon force-pushed the znixon/tcp-route branch from bd395dd to 9775551 Compare May 5, 2026 04:02
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2026
@youngnick

Copy link
Copy Markdown
Contributor

Fine for Provisional, let's get on to pushing this towards Standard.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 5, 2026
@rikatz

rikatz commented May 5, 2026

Copy link
Copy Markdown
Member

/hold cancel

Thanks @zac-nixon

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2026
@k8s-ci-robot
k8s-ci-robot merged commit 32e498c into kubernetes-sigs:main May 5, 2026
20 checks passed
@github-project-automation github-project-automation Bot moved this from Needs sponsors to Done in Gateway API - Next Experimental May 5, 2026
@kflynn kflynn moved this from Done to Needs documentation in Gateway API - Next Experimental May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/gep PRs related to Gateway Enhancement Proposal(GEP) lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants