Hello everyone, my name is CongwangLi and I am an Open Source Promotion Plan 2022 student working with ZhangChao(tokers).
Here is my proposal. My objective is to support using functions in OpenFunction as routing "upstream" via plugins to enable access to Faas functions. 1.Background: OpenFunction is a cloud-native open source FaaS (Function as a Service) platform aiming to let you focus on your business logic without having to maintain the underlying runtime environment and infrastructure. 1.1 OpenFunction features include: 1. Cloud agnostic and decoupled with cloud providers' BaaS 2. Pluggable architecture that allows multiple function runtimes 3. Support both sync and async functions 4. Unique async functions support that can consume events directly from event sources 5. Support generating OCI-Compliant container images directly from function source code. 6. Flexible autoscaling between 0 and N 7. Advanced async function autoscaling based on event sources' specific metrics 8. Simplified BaaS integration for both sync and async functions by introducing Dapr 9. Advanced function ingress & traffic management powered by K8s Gateway API (In Progress) 10. Flexible and easy-to-use events management framework 2. Implementation design 2.1 Objectives Supports using functions in OpenFunction as routing "upstream" via plugins to enable access to Faas functions. 2.2 name The plugin is named openfunction, and the priority is -1902, ranking after openwhisk. 2.3 Test Environment Prepare the kubernetes environment, download OFN, the CLI of openfunction and execute the following command. “ofn install --all” Then run openfunction samples according to the official documentation. 2.4 Authentication At present, openfunction provides two function entries, one is advanced function ingress & Traffic Management powered by k8s gateway API (in progress) which has many authentication methods vary from different implementations. The other is the default gateway kourier(https://github.com/knative-sandbox/net-kourier) that supports external auth. Therefore, I think basic auth can be a default authentication method for most of k8s gateways. 2.5 parameters 1. function_Uri 2. ssl_verify 3. service_token Description: By using basic auth ,the token format is 'xx:xx'.Since openfunction does not require authentication ,it is optional. 4. timeout 5. keepalive 6. keepalive_timeout 7. keepalive_pool 2.6 example ``` curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "plugins": { "openfunction": { "function_uri": "http://localhost:30585/default/function-sample/world", "service_token": “foo:foo123” } }, "uri": "/gohello" }' ``` ``` POST http://localhost:30585/default/function-sample/world Authentication: Basic xxxxx {"payload":"Hello, world!"} ``` I would like to hear everyone's comments. Thanks! Best, CongwangLi