kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
253 stars 21 forks source link

StaticRoute restructure #869

Closed aabedraba closed 1 year ago

aabedraba commented 1 year ago

Static Routes allow creating different paths like the following:

apiVersion: gateway.kusk.io/v1alpha1
kind: StaticRoute
metadata:
  name: sample
spec:
  fleet:
    name: kusk-gateway-envoy-fleet
    namespace: kusk-system
  paths:
    /: # <-- frontend path
      get: 
        route: &root_route
          upstream:
            service:
              name: frontend-app-svc
              namespace: default
              port: 3000 

but usually when deploying a frontend, popular frameworks like react and nextjs create many requests that are not included in the described path, for example:

image

Perhaps we could move to top level extensions? For example:

apiVersion: gateway.kusk.io/v1alpha1
kind: StaticRoute
metadata:
  name: sample
spec:
  fleet:
    name: kusk-gateway-envoy-fleet
    namespace: kusk-system
  upstream:
    service:
      name: frontend-app-svc
      namespace: default
      port: 3000

And while we're on it, could we maybe change the name StaticRoute which is very undescriptive of this feature that frontenders use to something more common like "Pages" (this is just an option I saw pretty much used by github and cloudeflare)? Open to suggestions.

donnalux commented 1 year ago

@aabedraba the team suggestions for renaming static routes can be found here

kylehodgetts commented 1 year ago

Already implemented