aws / aws-application-networking-k8s

A Kubernetes controller for Amazon VPC Lattice
https://www.gateway-api-controller.eks.aws.dev/
Apache License 2.0
175 stars 50 forks source link

Support for `urlRewrite` filter in HTTPRoute. #679

Open ghostx31 opened 1 week ago

ghostx31 commented 1 week ago

Hello, I am currently trying to do a POC on EKS for Gateway API.

I found out there is no filter for urlRewrite in the EKS implementation of the Gateway API.

Here's the HTTPRoute I am using:

kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
  name: podinfo-http-route
  namespace: podinfo
spec:
  parentRefs:
  - kind: Gateway
    name: pegasus-cluster-gateway
    namespace: pegasus-cluster-gateway
    sectionName: http
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: "/podinfo/"
    backendRefs:
    - name: podinfo-svc
      namespace: podinfo
      weight: 1
      port: 9898
    filters:
    - type: URLRewrite
      urlRewrite:
        path:
          type: ReplacePrefixMatch
          replacePrefixMatch: /

This gives the following error: Error from server (BadRequest): error when creating "STDIN": HTTPRoute in version "v1beta1" cannot be handled as a HTTPRoute: strict decoding error: unknown field "spec.rules[0].filters[0].urlRewrite" but I do not encounter this error on GCP's implementation of the Gateway API.

The Gateway controller has been deployed via kubectl and we are running the version: v1.0.7 on EKS 1.29.

Let me know in case any more information is required.

Thanks!