Skip to content

bug: Gateway not showing correct number of attached routes in status.listeners #2620

@mulimoen

Description

@mulimoen

Current Behavior

I have created an UDPRoute [0] and matching listener in a Gateway [1]. Running kubectl -n apisix-ingress get gateway/gatty-udp-12345 -o yaml shows no attached route.

The route is being attached and forwarding traffic correctly.

An HTTPRoute is also showing the same behaviour with no attached route despite the route being forwarded to the service correctly. Making an edit to the route forces an update of the gateway status showing that one route is attached.

I noticed Kind is not supported between protocol: UDP and UDPRoute as Gateway emits the following in the output.

supportedKinds:
    - group: gateway.networking.k8s.io
      kind: HTTPRoute

I tried overwriting with the UDPRoute as in [1], this resulted in supportedKinds being empty.

[0]

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: UDPRoute
metadata:
  name: myroute
  namespace: myapp
spec:
  parentRefs:
    - name: gatty-udp-12345
      namespace: apisix-ingress
  rules:
    - name: myroute
      backendRefs:
        - name: myservice
          port: 12345

[1]

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: gatty-udp-12345
  namespace: apisix-ingress
spec:
  gatewayClassName: apisix-gc
  listeners:
    - protocol: UDP
      port: 12345
      name: udp-12345
      allowedRoutes:
        namespaces:
          from: All
        # kinds:
        #   - group: gateway.networking.k8s.io
        #     kind: UDPRoute
  infrastructure:
    parametersRef:
      group: apisix.apache.org
      kind: GatewayProxy
      name: apisix-config

Expected Behavior

  • Adding an UDPRoute or HTTPRoute should update the spec.listeners.attachedRoutes field of the gateway
  • gateway should show UDPRoute in supportedKinds
  • gateway should show attachedRoutes: 1 on applying the UDPRoute

Error Logs

No response

Steps to Reproduce

  1. Install the APISIX Ingress controller in traditional mode with the Helm chart, updating the image of the ingress controller to the most recent version
  2. Create a route and gateway as described above
  3. Check attached routes using kubectl -n apisix-ingress get gateway/gatty-udp-12345 -o yaml

Environment

  • Helm chart 2.12.1
  • APISIX Ingress controller version (run apisix-ingress-controller version --long)
    docker image 2.0.0-rc5 (it did not work with the original helm chart version either)
  • Kubernetes cluster version (run kubectl version)
    Client Version: v1.34.1
    Kustomize Version: v5.7.1
    Server Version: v1.33.1
  • OS version if running APISIX Ingress controller in a bare-metal environment (run uname -a)
    N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions