Skip to content

[Gateway API] Incorrect selection between HTTPRouteRules with same matching rules #42964

Description

@qts0312

Is there an existing issue for this?

  • I have searched the existing issues

Version

equal or higher than v1.18.4 and lower than v1.19.0

What happened?

According to the Gateway API reference, when a tie occurs between HTTPRouteRules, the first rule should be selected. However, this behavior is as expected in practice.

Take the following HTTPRoute as an example. when the ratings service exists, requests are sometimes routed to ratings and sometimes to productpage. When the ratings service does not exist, the first rule is skipped, and all requests are routed to productpage. The behaviors under this two occasions are both inconsistent to the reference.

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: hr
spec:
  parentRefs:
    - name: my-gateway
  rules:
    - matches:
        - path:
            type: Exact
            value: /productpage
      backendRefs:
        - name: ratings
          port: 8080
    - matches:
        - path:
            type: Exact
            value: /productpage
      backendRefs:
        - name: productpage
          port: 9080

How can we reproduce the issue?

  1. Create a Cilium cluster with
cilium install --version 1.18.4 \
    --set kubeProxyReplacement=true \
    --set gatewayAPI.enabled=true \
    --set nodePort.enabled=true
  1. Deploy gateway and services (ratings and productpage).
  2. Apply the HTTPRoute above.
  3. curl http://"$GATEWAY":80/productpage.

Cilium Version

v1.18.4

Kernel Version

6.12.54-linuxkit

Kubernetes Version

Client Version: v1.34.1
Kustomize Version: v5.7.1
Server Version: v1.34.0

Regression

No response

Sysdump

cilium-sysdump-20251125-161445.zip

Relevant log output

Anything else?

No response

Cilium Users Document

  • Are you a user of Cilium? Please add yourself to the Users doc

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

area/agentCilium agent related.area/servicemeshGH issues or PRs regarding servicemeshfeature/k8s-gateway-apikind/bugThis is a bug in the Cilium logic.kind/community-reportThis was reported by a user in the Cilium community, eg via Slack.pinnedThese issues are not marked stale by our issue bot.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions