Skip to content

ListenerSet hostname conflict causes all ListenerSets to become conflicted #9105

Closed

Description

@TheisFerre

Description:

Reading GEP-1713 on conflicts between two ListenerSets, a conflict between two ListenerSets should keep the oldest ListenerSet Accepted, while the newest ListenerSet will receive the status Conflicted=True

When i deploy two conflicting ListenerSets that use the same hostname and port combination, both ListenerSets ends up as Conflicted=True, meaning any attached HTTPRoute will stop receiving traffic. This means that the HTTPRoute that was attached to the oldest ListenerSet suddenly stops being Accepted

Reproduction steps:

Step 1

The following HTTPRoute and ListenerSet is running in namespace dev-a and accepting traffic:

--- HTTPRoute
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  creationTimestamp: '2026-05-21T10:27:11Z'
  name: route-a
  namespace: dev-a
spec:
  hostnames:
    - domain.example.tld
  parentRefs:
    - group: gateway.networking.k8s.io
      kind: ListenerSet
      name: listenerset-a
  rules:
    - backendRefs:
        - group: ''
          kind: Service
          name: my-svc
          port: 80
          weight: 1
      matches:
        - path:
            type: PathPrefix
            value: /
status:
  parents:
    - conditions:
        - lastTransitionTime: '2026-05-28T13:37:06Z'
          message: Route is accepted
          observedGeneration: 1
          reason: Accepted
          status: 'True'
          type: Accepted
        - lastTransitionTime: '2026-05-28T13:37:06Z'
          message: Resolved all the Object references for the Route
          observedGeneration: 1
          reason: ResolvedRefs
          status: 'True'
          type: ResolvedRefs
      controllerName: gateway.envoyproxy.io/gatewayclass-controller
      parentRef:
        group: gateway.networking.k8s.io
        kind: ListenerSet
        name: listenerset-a

--- ListenerSet A

apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
  creationTimestamp: '2026-05-21T10:27:11Z'
  name: listenerset-a
  namespace: dev-a
spec:
  listeners:
    - allowedRoutes:
        namespaces:
          from: Same
      hostname: domain.example.tld
      name: domain-example-tld
      port: 443
      protocol: HTTPS
      tls:
        certificateRefs:
          - group: ''
            kind: Secret
            name: domain-example-tld-tls
        mode: Terminate
  parentRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: envoy-gateway
    namespace: envoy-gateway-system
status:
  conditions:
    - lastTransitionTime: '2026-05-28T13:37:06Z'
      message: All listeners are accepted
      observedGeneration: 1
      reason: Accepted
      status: 'True'
      type: Accepted
    - lastTransitionTime: '2026-05-28T13:37:06Z'
      message: All listeners are programmed
      observedGeneration: 1
      reason: Programmed
      status: 'True'
      type: Programmed
  listeners:
    - attachedRoutes: 1
      conditions:
        - lastTransitionTime: '2026-05-28T13:37:06Z'
          message: Sending translated listener configuration to the data plane
          observedGeneration: 1
          reason: Programmed
          status: 'True'
          type: Programmed
        - lastTransitionTime: '2026-05-28T13:37:06Z'
          message: Listener has been successfully translated
          observedGeneration: 1
          reason: Accepted
          status: 'True'
          type: Accepted
        - lastTransitionTime: '2026-05-28T13:37:06Z'
          message: Listener references have been resolved
          observedGeneration: 1
          reason: ResolvedRefs
          status: 'True'
          type: ResolvedRefs
        - lastTransitionTime: '2026-05-28T13:37:06Z'
          message: No conflicts detected
          observedGeneration: 1
          reason: NoConflicts
          status: 'False'
          type: Conflicted
      name: domain-example-tld
      supportedKinds:
        - group: gateway.networking.k8s.io
          kind: HTTPRoute
        - group: gateway.networking.k8s.io
          kind: GRPCRoute

Step 2

Deploy another ListenerSet in namespace dev-b with the following spec:

apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
  name: listenerset-b
  namespace: dev-b
spec:
  parentRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: envoy-gateway
    namespace: envoy-gateway-system
  listeners:
    - allowedRoutes:
        namespaces:
          from: Same
      hostname: domain.example.tld
      name: domain-example-tld
      port: 443
      protocol: HTTPS
      tls:
        certificateRefs:
          - group: ''
            kind: Secret
            name: domain-example-tld-tls
        mode: Terminate

Step 3

Observe the original/old ListenerSet become Conflicted:

apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
  creationTimestamp: '2026-05-21T10:27:11Z'
  name: listenerset-a
  namespace: dev-a
spec:
  listeners:
    - allowedRoutes:
        namespaces:
          from: Same
      hostname: domain.example.tld
      name: domain-example-tld
      port: 443
      protocol: HTTPS
      tls:
        certificateRefs:
          - group: ''
            kind: Secret
            name: domain-example-tld-tls
        mode: Terminate
  parentRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: envoy-gateway
    namespace: envoy-gateway-system
status:
  conditions:
    - lastTransitionTime: '2026-05-28T14:04:12Z'
      message: No listeners are accepted
      observedGeneration: 1
      reason: ListenersNotValid
      status: 'False'
      type: Accepted
    - lastTransitionTime: '2026-05-28T14:04:12Z'
      message: No listeners are programmed
      observedGeneration: 1
      reason: ListenersNotValid
      status: 'False'
      type: Programmed
  listeners:
    - attachedRoutes: 0
      conditions:
        - lastTransitionTime: '2026-05-28T14:04:12Z'
          message: All listeners for a given port must use a unique hostname
          observedGeneration: 1
          reason: HostnameConflict
          status: 'True'
          type: Conflicted
        - lastTransitionTime: '2026-05-28T14:04:12Z'
          message: Listener is invalid, see other Conditions for details.
          observedGeneration: 1
          reason: ListenersNotValid
          status: 'False'
          type: Programmed
        - lastTransitionTime: '2026-05-28T14:04:12Z'
          message: Listener references have been resolved
          observedGeneration: 1
          reason: ResolvedRefs
          status: 'True'
          type: ResolvedRefs
      name: domain-example-tld
      supportedKinds:
        - group: gateway.networking.k8s.io
          kind: HTTPRoute
        - group: gateway.networking.k8s.io
          kind: GRPCRoute

The newly created ListenerSet also becomes conflicted. This results in traffic to any attached HTTPRoute that has one of these ListenerSets and parentRef will not receive traffic anymore.

Environment:
Gateway version v1.8.0

Logs:
I did not find any relevant logs on the envoy-gateway controller resource even with debug logs.

The logs on the envoy-gateway-proxy confirms that no HTTPRoute is attached after the conflict.

{":authority":"example.domain.tld","bytes_received":0,"bytes_sent":0,"connection_termination_details":null,"downstream_local_address":"10.128.1.32:10443","downstream_remote_address":"10.129.16.84:55110","duration":0,"method":"GET","protocol":"HTTP/1.1","requested_server_name":"example.domain.tld","response_code":404,"response_code_details":"route_not_found","response_flags":"NR","route_name":null,"start_time":"2026-05-28T14:20:18.615Z","upstream_cluster":null,"upstream_host":null,"upstream_local_address":null,"upstream_transport_failure_reason":null,"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36","x-envoy-origin-path":"/","x-envoy-upstream-service-time":null,"x-forwarded-for":"10.129.16.84","x-request-id":"485644fe-74e5-4dbb-bc23-3c9f23f7a57d"}
{":authority":"example.domain.tld","bytes_received":0,"bytes_sent":0,"connection_termination_details":null,"downstream_local_address":"10.128.1.32:10443","downstream_remote_address":"10.129.16.84:55110","duration":0,"method":"GET","protocol":"HTTP/1.1","requested_server_name":"example.domain.tld","response_code":404,"response_code_details":"route_not_found","response_flags":"NR","route_name":null,"start_time":"2026-05-28T14:20:18.828Z","upstream_cluster":null,"upstream_host":null,"upstream_local_address":null,"upstream_transport_failure_reason":null,"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36","x-envoy-origin-path":"/","x-envoy-upstream-service-time":null,"x-forwarded-for":"10.129.16.84","x-request-id":"87888cf7-0712-464d-bf3f-f00ee481a2bb"}

Activity

  1. added
    kind/bug
    and removed on May 29, 2026
  2. zirain commented on May 29, 2026

    @zirain
    Member

    will be fixed in #8910

  3. Balsir commented on Jun 3, 2026

    @Balsir

    I have encountered the same problem, just with the original listener being created via the Gateway configuration. When I install a ListenerSet with a conflicting listener, both the Gateway listener and ListenerSet listener become conflicted.

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

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions