Skip to content

CFP: Support TCPRoute and UDPRoute in Cilium Gateway API #21929

Description

@sayboras

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

  1. github-actions commented on Jan 8, 2023

    @github-actions

    This issue has been automatically marked as stale because it has not
    had recent activity. It will be closed if no further activity occurs.

  2. added
    staleThe stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale.
    on Jan 8, 2023
  3. added
    pinnedThese issues are not marked stale by our issue bot.
    and removed
    staleThe stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale.
    on Jan 8, 2023
  4. aojea commented on Mar 16, 2023

    @aojea
    Contributor

    /cc

  5. changed the title [-]CFP: Support TCPRoute in Cilium Gateway API[/-] [+]CFP: Support TCPRoute and UDPRoute in Cilium Gateway API[/+] on May 3, 2023
  6. youngnick commented on May 8, 2023

    @youngnick
    Contributor

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

  7. aojea commented on May 8, 2023

    @aojea
    Contributor

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

    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

  8. Sammcb commented on Oct 6, 2023

    @Sammcb

    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!

  9. eminaktas commented on Oct 24, 2023

    @eminaktas
    Contributor

    /cc

  10. a1994sc commented on Dec 30, 2023

    @a1994sc

    Is there any chance this will be included in the v1.5.0 release? Thank you for your hard work!

  11. especially-relative commented on Jan 11, 2024

    @especially-relative

    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.

    Is this not planned on the initial implementation, or are there technical limitations of Cilium that prevent mixing TCPRoute/UDPRoute with higher layers?

  12. 97 remaining items

  13. jonioni commented on Jan 22, 2026

    @jonioni

    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?

  14. ruben-caceiro-digiwest commented on Jan 22, 2026

    @ruben-caceiro-digiwest

    @ruben-caceiro-digiwest I use just a simple LoadBalancer to expose my UDP/TCP services (SQL or DNS for instance). If you're not in a tight place with IP addresses it's probably fine, depending on how many services you want to expose.

    yup ... I will try something like that also, thanks

  15. chiqors commented on Jan 26, 2026

    @chiqors

    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

  16. youngnick commented on Jan 27, 2026

    @youngnick
    Contributor

    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?

    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.

  17. IceBreaker8 commented on Feb 4, 2026

    @IceBreaker8

    I'd be amazing if they added support for UDProute, somebody got a minecraft/hytale server to run 😢

  18. reneleonhardt commented on Feb 5, 2026

    @reneleonhardt

    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

    	tlsRoute = schema.GroupVersionResource{
    		Group:    "gateway.networking.k8s.io",
    		Resource: "tlsroutes",
    		Version:  "v1alpha2",
    	}
  19. added 2 commits that reference this issue on Feb 26, 2026
    f619670
    9cc01d1
  20. binary-zero-one commented on Mar 20, 2026

    @binary-zero-one

    Hope this will land in the 1.20 release

  21. added a commit that references this issue on Apr 7, 2026
    84102c5
  22. binary-zero-one commented on May 5, 2026

    @binary-zero-one

    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?

  23. youngnick commented on May 6, 2026

    @youngnick
    Contributor

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

  24. kainz commented on May 6, 2026

    @kainz

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentCilium agent related.area/servicemeshGH issues or PRs regarding servicemeshkind/cfpCilium Feature Proposalkind/featureThis introduces new functionality.pinnedThese issues are not marked stale by our issue bot.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions