Repository navigation
Description
Cilium Feature Proposal
The first cut for Gateway API was done in #21749, however, we have a couple of follow-up tasks to support more features from Gateway API upstream.
This is to track the work to support TCPRoute and UDPRoute
Goals
- Support TCPRoute and UDPRoute whereever Cilium is used
Background
When talking about supporting TCPRoute and UDPRoute in Cilium, there are some important things to note:
- The functionality is basically equivalent to creating a Loadbalancer type Service
- Because of that, theoretically, Cilium's LB-IPAM feature, combined with the BGP Control Plane feature, could be used to handle Gateway address allocation as well, and then route traffic as directed with TCPRoute and UDPRoute.
- Current Gateway API support (for HTTPRoute and soon, TLSRoute) is implemented by having the Cilium Operator provision a Loadbalancer Service (in shared LB mode, or one per Gateway in dedicated mode) that points to the per-node proxy deployment that Cilium uses for Layer 7 routing.
Because of this, if we build support for TCPRoute and UDPRoute Gateways using Loadbalancer Services, then we may conceivably need to do a migration in the future for folks who are using LB-IPAM. We can make this migration possible using the ownerRefs that we already apply to created Service objects.
Because of this, we'll look at Gateway API interactions with LB-IPAM later on.
Proposed Solution
For now, this CFP proposes creating a Loadbalancer Service per Gateway that has TCPRoutes and/or UDPRoutes attached as a first cut.
We will look at if we can collapse multiple Gateways onto a smaller set of Loadbalancer Services, but it's much more likely that conflicts will arise with the Layer 4 constructs than with Layer 7 constructs. kubernetes-sigs/gateway-api#1863 will probably end up being relevant here, as we may be able to use those mechanisms to cut down on the number of looad balancers created.
Cilium will not support having a single Gateway that mixes Layer 4 constructs like TCPRoute and UDPRoute with higher-layer constructs like HTTPRoute, TLSRoute, or GRPCRoute. Such Gateways will be marked as incompatible using Gateway API's standard methods and not accepted for processing.
Listener Ports will be translated to ports in the Loadbalancer Service, with the backends set as specified in the associated TCPRoute or UDPRoute.
Since the spec of both TCPRoute and UDPRoute is quite straightforward, that should be sufficient to get us started.
Tasks
Exact tasks TBD, needs a code review to get some idea of what the implementation will need to look like.
Activity
github-actions commentedon Jan 8, 2023
This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.
aojea commentedon Mar 16, 2023
/cc
[-]CFP: Support TCPRoute in Cilium Gateway API[/-][+]CFP: Support TCPRoute and UDPRoute in Cilium Gateway API[/+]youngnick commentedon May 8, 2023
#9207 may also be relevant here, because if a Gateway has UDPRoutes and TCPRoutes attached to the same Gateway on the same port number (could be a different Listener though), then #9207 may be relevant.
Going to do some testing today to check.
aojea commentedon May 8, 2023
The interesting thing with #9207 is that most people (like me) assumes that both protocols will not work at the same time, but it seems that the effect is that it will ALWAYS forward both protocols, despite only one is configured, see e2e test reproducing the issue kubernetes/kubernetes#116333
Just a heads up, since this can present a network security problem, we are going to discuss next sig-network meeting to promote this test to Conformance https://docs.google.com/document/d/1_w77-zG_Xj0zYvEMfQZTQ-wPP4kXkpGD8smVtW_qqWM/edit
Sammcb commentedon Oct 6, 2023
Hi all! I was hoping to use a TCPRoute with Cilium, and was curious if there was a potential rough timeline for this. Will this depend on these Routes reaching beta phase in gateway-api? Really excited for all these new options, thanks so much!
eminaktas commentedon Oct 24, 2023
/cc
a1994sc commentedon Dec 30, 2023
Is there any chance this will be included in the
v1.5.0release? Thank you for your hard work!especially-relative commentedon Jan 11, 2024
Is this not planned on the initial implementation, or are there technical limitations of Cilium that prevent mixing TCPRoute/UDPRoute with higher layers?
97 remaining items
jonioni commentedon Jan 22, 2026
Would it be feasible for Cilium to initially implement TCPRoute support using Envoy—since it’s relatively straightforward and low effort—so it’s not a blocking factor, and then later, when capacity allows, replace it with a more Cilium-native implementation?
ruben-caceiro-digiwest commentedon Jan 22, 2026
yup ... I will try something like that also, thanks
chiqors commentedon Jan 26, 2026
i am looking for the updates for TCPRoute and UDPRoute.. i have game servers and also some services to test this out while using cilium as cni
youngnick commentedon Jan 27, 2026
It's possible, sure, but I'm worried that there will be differences enough in the behavior of the feature that it will require management and migration processes that will also be a lot of work.
IceBreaker8 commentedon Feb 4, 2026
I'd be amazing if they added support for UDProute, somebody got a minecraft/hytale server to run 😢
reneleonhardt commentedon Feb 5, 2026
https://github.com/kubernetes-sigs/gateway-api/pull/4439 mentions that Cilium is on a good track to become standard-conformant.
Can this work be seen here, what's left to do?
As far as I understand, alpha3 is being promoted to v1, but Cilium still uses alpha2.
https://github.com/cilium/cilium/blob/main/cilium-cli/sysdump/constants.go#L197
feat(gateway-api): add TCPRoute and UDPRoute support
gateway-api: add TCPRoute and UDPRoute support
binary-zero-one commentedon Mar 20, 2026
Hope this will land in the 1.20 release
gateway-api: add TCPRoute and UDPRoute support
fix(sfu): use hostPort for UDP instead of UDPRoute
binary-zero-one commentedon May 5, 2026
Given that the RC for version 1.20 is coming out in a month and the full release is in two months, and since the PR is marked as a draft and requires CFP discussion, is it fair to say that the chances of seeing UDP/TCPRoutes in the upcoming version are pretty much zero? And should we just wait another 8 months and hope for the best?
youngnick commentedon May 6, 2026
It looks like that at the moment, yes, unless we get pretty quick consensus on the new CRD that @eminaktas' implementation adds.
I should emphasize that one of the reasons this has taken so long is that it's actually pretty hard to do this correctly. So, while I would love to see this make it into v1.20, it's all dependent on the community moving things forward. So, if you want this, make noise! Here, or on the CFP for the new CRD (#45654).
kainz commentedon May 6, 2026
Getting this routing unified under one CRD will make configuration significantly less surprising. To inplement combined HTTP(s)/TCP/UDP service involving a Gateway CRD and Cilium IPAM ip service today requires games with stateful Service reconfiguration and jankery with cilium lbipam service sharing keys, which is also not very well documented. At least on 1.18, it seems like you cant setup a gateway with the correct annotations in one shot, as they dknt carry through to the generated service object.