Skip to content

[Gateway API] Multiple TLS Passthrough listeners with the same Hostname on different ports fail #42898

Open

Description

@ruben-caceiro-digiwest

Is there an existing issue for this?

  • I have searched the existing issues

Version

equal or higher than v1.17.10 and lower than v1.18.0

What happened?

I am attempting to configure a Gateway using cilium where I need to expose two different services (MQTT over SSL and WebSockets over SSL) using TLS Passthrough.
Both services share the same DNS hostname (SNI) but listen on different ports (e.g., 8883 and 8443).
According to the Gateway API specification, listeners should be distinct if their ports are different. However, when I attempt to configure two listeners with protocol: TLS, mode: Passthrough, and identical hostname values, the configuration fails/does not work as expected.

How can we reproduce the issue?

---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: my-gateway
  namespace: default
spec:
  gatewayClassName: cilium
  listeners:
    # Listener 1: MQTT Secure
    - name: mqtts
      hostname: mqtt.example.com
      port: 8883
      protocol: TLS
      tls:
        mode: Passthrough
    
    # Listener 2: WSS Secure (Same hostname, different port)
    - name: wss
      hostname: mqtt.example.com
      port: 8443
      protocol: TLS
      tls:
        mode: Passthrough

---
# Route 1: Attaches to the 'mqtts' listener on port 8883
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TLSRoute
metadata:
  name: route-mqtts
  namespace: default
spec:
  hostnames:
    - mqtt.example.com
  parentRefs:
    - name: my-gateway
      sectionName: mqtts # Explicitly targeting listener 1
  rules:
    - backendRefs:
        - name: mqtt-service
          port: 8883

---
# Route 2: Attaches to the 'wss' listener on port 8443
# This is where the conflict usually manifests
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TLSRoute
metadata:
  name: route-wss
  namespace: default
spec:
  hostnames:
    - mqtt.example.com
  parentRefs:
    - name: my-gateway
      sectionName: wss # Explicitly targeting listener 2
  rules:
    - backendRefs:
        - name: wss-service
          port: 8443

Note: I have the proper ReferenceGrant created.
The route 1st route works while the 2nd doesn't. I comment the route 1, the 2nd works, when I reactivate 1st, and the 2nd no longer works again

Cilium Version

1.17.1

Kernel Version

6.8.0-87-generic

Kubernetes Version

Client Version: v1.34.2
Kustomize Version: v5.7.1
Server Version: v1.34.2

Regression

I don't know.

Sysdump

No response

Relevant log output

Anything else?

No response

Cilium Users Document

  • Are you a user of Cilium? Please add yourself to the Users doc

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    kind/bugThis is a bug in the Cilium logic.
    needs/triageThis issue requires triaging to establish severity and affected area.
    kind/community-reportThis was reported by a user in the Cilium community, eg via Slack.
    on Nov 20, 2025
  2. youngnick commented on Nov 21, 2025

    @youngnick
    Contributor

    Thanks for this issue @ruben-caceiro-digiwest. Unfortunately, this sort of thing is currently a known issue with Cilium's implementation of Gateway API - because we pull all of the TLS config into a single port and filter chain, and use Cilium's eBPF datapath to get the packets to the right spot. It's on my list to fix, but it requires a reasonable rework of how we write out the filter chains, so I haven't got to it yet.

    Totally a problem, will be fixed when we can. Sorry.

  3. ruben-caceiro-digiwest commented on Nov 21, 2025

    @ruben-caceiro-digiwest
    Author
  4. added
    pinnedThese issues are not marked stale by our issue bot.
    on Nov 24, 2025
  5. removed
    needs/triageThis issue requires triaging to establish severity and affected area.
    on May 21, 2026
  6. arybolovlev commented on Jun 22, 2026

    @arybolovlev
    Contributor

    This issue seems to be addressed by this PR: #44889.

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

Metadata

Metadata

Assignees

Labels

area/agentCilium agent related.area/servicemeshGH issues or PRs regarding servicemeshfeature/k8s-gateway-apikind/bugThis is a bug in the Cilium logic.kind/community-reportThis was reported by a user in the Cilium community, eg via Slack.pinnedThese issues are not marked stale by our issue bot.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions