gloo icon indicating copy to clipboard operation
gloo copied to clipboard

REST DestinationSpec for K8S Gateway API

Open DuncanDoyle opened this issue 1 year ago • 0 comments

Design and implement the a DestinationSpec API for Rest Function Upstreams for K8S Gateway API.

Context

See als the parent issue for the context and motivation: https://github.com/solo-io/gloo/issues/9712

In our current implementation to support function parameters for Function Upstreams in K8S Gateway API, we use an ExtensionRef to a virtual Parameter resource to pass in, for example, the logical name of the Lambda function to call. See https://github.com/solo-io/solo-projects/issues/6160#issuecomment-2161397367, which contains the following example:

backendRefs:
    - name: lambda
      namespace: gloo-system
      group: gloo.solo.io
      kind: Upstream
      filters:
        - type: ExtensionRef
          extensionRef:
            group: "gloo.solo.io"
            kind: Parameter
            name: echo

Since this is an unnamed parameter, we only support on Function Upstream parameter to be specified. There are however destinationSpec in the Gloo Edge API that support multiple parameters: https://docs.solo.io/gloo-edge/latest/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options.proto.sk/#destinationspec

The REST destinationSpec for example supports fields like functionName, parameters and responseTransformation: https://docs.solo.io/gloo-edge/latest/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/rest/rest.proto.sk/#destinationspec

With the current K8S Gateway API implementation, we can't/don't support these additional parameters.

Requirement

Design and implement an API for the K8S Gateway API that provides support for DestinationSpecs with multiple parameters for REST Upstreams.

DuncanDoyle avatar Jul 24 '24 17:07 DuncanDoyle