Skip to content

Xds Translator Incorrectly Creates Listener #382

@danehans

Description

@danehans

Description:
The xds translator is creating a listener when listener creation is unneeded. Instead, the existing listener name and allowed hostnames should be updated.

Repro steps:

  • Follow quickstart guide but update gateway.listerns[].hostname: "*.example.com"
  • Create a 2nd gateway with a listen that uses a different hostname:
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: Gateway
metadata:
  name: eg-2
spec:
  gatewayClassName: eg
  listeners:
    - name: http
      hostname: "*.foo.com"
      protocol: HTTP
      port: 8080
  • Create a 2nd route that references the 2nd gateway:
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
metadata:
  name: httpbin-2
spec:
  parentRefs:
    - name: eg-2
  hostnames:
    - "www.foo.com"
  rules:
    - backendRefs:
        - group: ""
          kind: Service
          name: httpbin
          port: 80
          weight: 1
      matches:
        - path:
            type: PathPrefix
            value: /
  • Tail the EG logs and observe:
2022-09-13T20:50:34.005Z	INFO	cache/logrwrapper.go:24	handling v3 xDS resource request, version_info 6, response_nonce 1975, nodeID envoy-9c56d94bc-6sjvz, node_version v1.23.1, resource_names [], type_url type.googleapis.com/envoy.config.listener.v3.Listener, errorCode 13, errorMessage Error adding/updating listener(s) listener_default-eg-2-http_8080: error adding listener: 'listener_default-eg-2-http_8080' has duplicate address '0.0.0.0:8080' as existing listener

The Gateway APi spec states that the listeners should be merged.

Metadata

Metadata

Assignees

Labels

area/translatorIssues related to Gateway's translation service, e.g. translating Gateway APIs into the IR.area/xds-serverIssues related to the xDS Server used for managing Envoy configuration.kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions