kubeshop / kusk-gateway

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

StaticRoutes: upstream #954

Open jasmingacic opened 2 years ago

jasmingacic commented 2 years ago

this is extension of this issue #869

Upstream should be added to top level properties.

apiVersion: gateway.kusk.io/v1alpha1
kind: StaticRoute
metadata:
  name: kusk-gateway-dashboard
  namespace: kusk-system
  labels:
    kusk-managed: "true"
spec:
  upstream:
     name:141241
     namespace: 2342134
  fleet:
    name: kusk-gateway-private-envoy-fleet
    namespace: kusk-system
  hosts:
    - localhost
    - "*"

Paths should be optional, and path cannot be root path of a service eg. /. Validation webhook and validation in the manager should be able to catch this. Everything else related to paths will have the same properties as before and route level upstream should overwrite top level upstream.

so spec.upstream will be replaced with spec.paths."/somepath".get.route.upstream if path level is upstream is defined.