Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gatewayapi: match rule was ignored #50108

Open
zirain opened this issue Mar 26, 2024 · 0 comments
Open

gatewayapi: match rule was ignored #50108

zirain opened this issue Mar 26, 2024 · 0 comments

Comments

@zirain
Copy link
Member

zirain commented Mar 26, 2024

input yaml:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: httpbin-gateway
  namespace: istio-system
spec:
  gatewayClassName: istio
  listeners:
    - name: http
      port: 80
      protocol: HTTP
      allowedRoutes:
        namespaces:
          from: All
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: match-order
spec:
  parentRefs:
    - group: gateway.networking.k8s.io
      kind: Gateway
      name: httpbin-gateway
      namespace: istio-system
  rules:
    - backendRefs:
        - group: ""
          kind: Service
          name: httpbin
          port: 8000
          weight: 1
      matches:
        - path:
            type: PathPrefix
            value: /api/store
        - path:
            type: RegularExpression
            value: ^/api/[1-9][0-9]*/.*$
    - backendRefs:
        - group: ""
          kind: Service
          name: httpbin
          port: 8000
          weight: 1
      matches:
        - path:
            type: PathPrefix
            value: /

output route:

- ignorePortInHostMatching: true
  maxDirectResponseBodySizeBytes: 1048576
  name: http.80
  validateClusters: false
  virtualHosts:
  - domains:
    - '*'
    includeRequestAttemptCount: true
    name: '*:80'
    routes:
    - decorator:
        operation: httpbin.default.svc.cluster.local:8000/*
      match:
        caseSensitive: true
        pathSeparatedPrefix: /api/store
      metadata:
        filterMetadata:
          istio:
            config: /apis/networking.istio.io/v1alpha3/namespaces/default/virtual-service/match-order-0-istio-autogenerated-k8s-gateway
      name: default.match-order.0
      route:
        cluster: outbound|8000||httpbin.default.svc.cluster.local
        clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR
        maxGrpcTimeout: 0s
        retryPolicy:
          hostSelectionRetryMaxAttempts: "5"
          numRetries: 2
          retriableStatusCodes:
          - 503
          retryHostPredicate:
          - name: envoy.retry_host_predicates.previous_hosts
            typedConfig:
              '@type': type.googleapis.com/envoy.extensions.retry.host.previous_hosts.v3.PreviousHostsPredicate
          retryOn: connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes
        timeout: 0s
    - decorator:
        operation: httpbin.default.svc.cluster.local:8000/*
      match:
        caseSensitive: true
        prefix: /
      metadata:
        filterMetadata:
          istio:
            config: /apis/networking.istio.io/v1alpha3/namespaces/default/virtual-service/match-order-0-istio-autogenerated-k8s-gateway
      name: default.match-order.1
      route:
        cluster: outbound|8000||httpbin.default.svc.cluster.local
        clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR
        maxGrpcTimeout: 0s
        retryPolicy:
          hostSelectionRetryMaxAttempts: "5"
          numRetries: 2
          retriableStatusCodes:
          - 503
          retryHostPredicate:
          - name: envoy.retry_host_predicates.previous_hosts
            typedConfig:
              '@type': type.googleapis.com/envoy.extensions.retry.host.previous_hosts.v3.PreviousHostsPredicate
          retryOn: connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes
        timeout: 0s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant