Skip to content

api.xxx.xxx HTTPS and TLS conflicted in the tenant-root's TenantGateway cozystack listeners #3720

Closed

Description

@crossRT

Describe the bug
When cozystack is freshly installed, the api.xxx.xxx HTTPS and TLS is conflicted in the tenant-root's TenantGateway cozystack listeners.
Causing the cilium-envoy refuses to accept and open for connection.

Environment

  • Cozystack version: v1.6.1
  • Provider: on-prem

To Reproduce
Steps to reproduce the behavior:

  1. Freshly install cozystack v1.6.1
  2. setup and configure the platform as documentation mentioned, but keep .spec.ingress: false in tenant-root
  3. enable gateway on platform level and tenant level as documentation mentioned.
  4. wait for all gateway related resources reconciled.
  5. run telnet to test port 80 and 443

Expected behaviour
when running telnet to test the IP for connectivity, it should able to establish the connection.

Actual behaviour
the port 80 and 443 is never opened on the IP.

Logs
cilium-envoy's log.
repeating following warning.

cilium-envoy-qn4sg [2026-08-09 03:25:51.550[][7[][warning[][config[] [external/envoy/source/extensions/config_subscription/grpc/grpc_subscription_impl.cc:138] gRPC config for type.googleapis.com/envoy.config.listener.v3.Listener rejected: Error adding/updating listener(s) tenant-root/cilium-gateway-cozystack/listener: error adding listener '127.0.0.1:11652': filter chain '' has the same matching rules defined as ''. duplicate matcher is: {"transport_protocol":"tls","server_names":["api.xxx.xxx"]}

Checklist

  • I have checked the documentation
  • I have searched for similar issues
  • I have included all required information
  • I have provided clear steps to reproduce
  • I have included relevant logs

Activity

  1. dosubot commented on Aug 10, 2026

    @dosubot

    Hi Ray Low (@crossRT)! I'm Dosu and I'm helping the Cozystack team.

    This is a known conflict between the wildcard HTTPS termination listener and the TLS passthrough listeners on port 443. Issue #3718 documents the same root cause [1].

    What's happening: When using dns01 or existingSecret cert mode, the TenantGateway controller creates a wildcard HTTPS listener for *.<apex> on port 443 with tls.mode: Terminate [2]. At the same time, each entry in tlsPassthroughServices (by default: api, vm-exportproxy, cdi-uploadproxy) creates a TLS passthrough listener on port 443 with hostname <service>.<apex> [3] [4]. Because the wildcard *.<apex> matches api.<apex>, both filter chains end up with an intersecting SNI match — and Cilium's Envoy translation on v1.19.5 produces two filter chains with identical transport_protocol: tls + server_names criteria, which Envoy rejects outright [1].

    Root cause: This is a limitation of Cilium v1.19.5 (the version pinned in Cozystack). The listener translation builds a single Envoy listener for the entire Gateway and cannot isolate overlapping SNI matches between terminate and passthrough filter chains on the same port. The fix is targeted for Cilium 1.20, with no backport to 1.19 [5].

    Possible workaround: If you're able to, you could try removing api from tlsPassthroughServices in the TenantGateway spec (if you don't need TLS passthrough for the Kubernetes API on this gateway), which would eliminate the overlapping SNI match and allow Envoy to accept the listener configuration. However, this would affect API server passthrough routing, so it depends on your setup.

    This is essentially the same issue as #3718 — you've now confirmed with a live cluster and cilium-envoy logs what that issue predicted from code analysis alone.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about cozystack with Dosu Add Dosu to your team

  2. lexfrei commented on Aug 14, 2026

    @lexfrei
    Contributor

    Reproduced from the templates. This is deterministic on a default install with the Gateway enabled, not something specific to your cluster.

    packages/system/cozystack-api/templates/api-tlsroute.yaml ships a TLSRoute named kubernetes-api in the default namespace with hostname api.<apex>, attaching by sectionName: tls-api. default sits in gateway.attachedNamespaces in the platform values, so collectHostnameClaims accepts that hostname as a claim. In http01, which is the default cert mode, the reconciler renders one HTTPS-terminate listener per claimed hostname and never subtracts the names already served by tlsPassthroughServices (internal/controller/tenantgateway/reconciler.go). That is how api.<apex> ends up with https-api-<hash> (HTTPS/Terminate) and tls-api (TLS/Passthrough) side by side on 443, exactly the pair in your listener dump.

    On the pinned Cilium the whole Gateway translates into a single Envoy listener, so the conflicting pair takes 443 down with it. That is why neither 80 nor 443 ever opened.

    Deleting the TLSRoute clears the claim and unblocks the listener, but the object is part of the cozystack-api chart, so Flux puts it back on the next reconcile, and while it is gone the tenant Kubernetes API is not published through the Gateway at all.

    Same shape in dns01 is #3718, and #3342 is the change that stops rendering a terminate listener for passthrough names in http01.

  3. added
    area/ciliumIssues or PRs related to Cilium (agent, operator, Gateway API, network policy, LB-IPAM)
    on Aug 19, 2026
  4. added
    area/networkingIssues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn)
    triage/not-reproducibleIndicates an issue can not be reproduced as described
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
  5. lexfrei commented on Sep 23, 2026

    @lexfrei
    Contributor

    Fixed on main by #3342: a hostname served by a passthrough listener no longer gets an HTTPS terminate listener too, so api.<apex> stops conflicting. It will ship in the next release after v1.6.3.

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/ciliumIssues or PRs related to Cilium (agent, operator, Gateway API, network policy, LB-IPAM)area/networkingIssues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn)kind/bugCategorizes issue or PR as related to a bugtriage/not-reproducibleIndicates an issue can not be reproduced as described

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions