gloo icon indicating copy to clipboard operation
gloo copied to clipboard

Design API for Multi-param DestinationSpec support in K8S Gateway API

Open DuncanDoyle opened this issue 1 year ago • 0 comments

Design the DestinationSpec API for 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 aws destinationSpec for example supports fields like wrapAsApiGateway, unwrapAsApiGateway, invocationStyle, etc.: https://docs.solo.io/gloo-edge/latest/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/aws/aws.proto.sk/

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

Requirement

[!NOTE] This issue focusses on the design of the Multi-param DestinationSpec API for K8S Gateway API. Implementation tasks for the various different Function Upstreams that we want to support is captured in subsequent tasks.

Define the API for Muli-param DestinationSpec support for Function Upstreams that can cover the following Function Upstream use-cases:

  • AWS Lambda. See: https://github.com/solo-io/gloo/issues/9814
  • Azure. See: https://github.com/solo-io/gloo/issues/9815
  • REST. See: https://github.com/solo-io/gloo/issues/9816

Job Stories

When I'm configuring a Function Upstream to be used as a backendRef of a K8S Gateway API HttpRoute, I want to be able to set all the parameters supported by the given Function Upstream, So I can use all Function Upstream capabilities that are available in the classic Gloo Edge API in the K8S Gateway API, so I can migrate my existing Function Upstream usage with the classic Gloo Edge API to the K8S Gateway API

┆Issue is synchronized with this Asana task by Unito

DuncanDoyle avatar Jul 31 '24 10:07 DuncanDoyle