Skip to content

HTTPRoute becomes Not Accepted when its ListenerSet wins a hostname conflict #9767

Closed

Description

@TheisFerre

Description:

This is a follow-up to #9105, which was fixed by #9192 and released in Envoy Gateway v1.9.0.

In v1.9.0, hostname conflict precedence between two ListenerSet resources is now reported correctly:

  • The older ListenerSet remains Accepted=True, Programmed=True, and Conflicted=False.
  • The newer conflicting ListenerSet becomes Accepted=False, Programmed=False, and Conflicted=True.

However, an HTTPRoute whose parentRef points to the older, non-conflicted ListenerSet becomes Accepted=False after the conflicting ListenerSet is created.

The winning ListenerSet also changes from attachedRoutes: 1 to attachedRoutes: 0.

Expected behavior:

  • The older ListenerSet remains accepted and programmed.
  • Its existing HTTPRoute remains Accepted=True.
  • Its listener continues reporting attachedRoutes: 1.
  • Creating the losing ListenerSet does not interrupt traffic through the winning ListenerSet.

Actual behavior:

  • The older ListenerSet remains accepted and non-conflicted.
  • Its listener changes to attachedRoutes: 0.
  • The HTTPRoute changes to Accepted=False with reason NoMatchingListenerHostname.
  • The route is removed from the generated configuration.

Repro steps:

  1. Create a Gateway that permits ListenerSet attachment:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: envoy-gateway
  namespace: envoy-gateway-system
spec:
  gatewayClassName: envoy-gateway
  allowedListeners:
    namespaces:
      from: All
  listeners:
    - name: http
      protocol: HTTP
      port: 80
      allowedRoutes:
        namespaces:
          from: All
  1. Create the first ListenerSet:
apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
  name: listenerset-a
  namespace: example
spec:
  parentRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: envoy-gateway
    namespace: envoy-gateway-system
  listeners:
    - name: example-com
      hostname: example.com
      port: 443
      protocol: HTTPS
      allowedRoutes:
        namespaces:
          from: Same
  1. Create an HTTPRoute referring to the first ListenerSet:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: route-a
  namespace: example
spec:
  hostnames:
    - example.com
  parentRefs:
    - group: gateway.networking.k8s.io
      kind: ListenerSet
      name: listenerset-a
  rules:
    - backendRefs:
        - group: ""
          kind: Service
          name: example
          port: 80
      matches:
        - path:
            type: PathPrefix
            value: /
  1. Verify the initial state:
ListenerSet listenerset-a:
  Accepted=True
  Programmed=True
  listener Conflicted=False
  attachedRoutes=1

HTTPRoute route-a:
  Accepted=True

  1. Create a newer ListenerSet with the same port and hostname:
apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
  name: listenerset-b
  namespace: example
spec:
  parentRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: envoy-gateway
    namespace: envoy-gateway-system
  listeners:
    - name: example-com-conflict
      hostname: example.com
      port: 443
      protocol: HTTPS
      allowedRoutes:
        namespaces:
          from: Same
  1. Observe that ListenerSet precedence is correct:
listenerset-a:
  Accepted=True
  Programmed=True
  Conflicted=False
  attachedRoutes=0

listenerset-b:
  Accepted=False
  Programmed=False
  Conflicted=True
  reason=HostnameConflict
  attachedRoutes=0
  1. Observe that the HTTPRoute attached to listenerset-a is rejected:
conditions:
  - message: There were no hostname intersections between the HTTPRoute and this parent ref's Listener(s).
    reason: NoMatchingListenerHostname
    status: "False"
    type: Accepted
  - message: Resolved all the Object references for the Route
    reason: ResolvedRefs
    status: "True"
    type: ResolvedRefs

The HTTPRoute spec and the winning listener both use the same hostname, example.com, so NoMatchingListenerHostname is unexpected.

Environment:

  • Envoy Gateway: v1.9.0
  • Envoy Proxy: v1.39.0
  • Kubernetes: v1.34.9-eks-8f14419

Activity

  1. TheisFerre commented on Aug 26, 2026

    @TheisFerre
    Author

    Hey @zirain and @zhaohuabing - just a friendly ping

    This is a blocker for us currently.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions