You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by CongwangLi <lc...@163.com> on 2022/07/05 07:51:52 UTC

[DISCUSS]Proposal:support openfunction serverless framework plugin


Hello everyone, my name is CongwangLi and I am an Open Source Promotion Plan 2022 student working with ZhangChao(tokers).
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.

OpenFunction features include:

Cloud agnostic and decoupled with cloud providers' BaaS
Pluggable architecture that allows multiple function runtimes
Support both sync and async functions
Unique async functions support that can consume events directly from event sources
Support generating OCI-Compliant container images directly from function source code.
Flexible autoscaling between 0 and N
Advanced async function autoscaling based on event sources' specific metrics
Simplified BaaS integration for both sync and async functions by introducing Dapr
Advanced function ingress & traffic management powered by K8s Gateway API (In Progress)
Flexible and easy-to-use events management framework
Implementation design

 

1.     Objectives

Supports using functions in OpenFunction as routing "upstream" via plugins to enable access to Faas functions.

2.     name

The plugin is named openfunction, and the priority is -1902, ranking after openwhisk

 

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.

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.

 

5.     parameters
|

Name

|

Type

|

Required

|

Default

|

Valid Values

|

Description

|
|

function_Url

|

String

|

True

|

 

|

 

|

 

|
|

ssl_verify

|

Boolean

|

Fales

|

True

|

 

|

 

|
|

service_token

|

String

|

False

|

 

|

 

|

Since openfunction does not require authentication, the token parameter is optional.

|
|

timeout

|

Integer

|

60000ms

|

 

|

 

|

 

|
|

keepalive

|

Boolean

|

False

|

 

|

 

|

 

|
|

keepalive_timeout

|

Integer

|

60000ms

|

 

|

 

|

 

|
|

keepalive_pool

|

Integer

|

5

|

 

|

 

|

 

|
 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



Re:Re: [DISCUSS]Proposal:support openfunction serverless framework plugin

Posted by CongwangLi <lc...@163.com>.


Sure!

Thanks for your reminding.And sorry for anyone who was disturbed.

















At 2022-07-05 22:26:08, "shirui zhao" <zh...@gmail.com> wrote:
>hi,
>You are very welcome to join the Apache APISIX community. Before you edit the email and send it, I hope you can make sure that the format of the email is readable. The format of the mail is very bad for me, I found it in the trash. So your email may not be seen by everyone, so can you re-edit your email and make it appear properly?
>
>——
>Thanks,
>Shirui Zhao
>
>> 2022年7月5日 15:51,CongwangLi <lc...@163.com> 写道:
>> 
>> 
>> 
>> Hello everyone, my name is CongwangLi and I am an Open Source Promotion Plan 2022 student working with ZhangChao(tokers).
>> 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.
>> 
>> OpenFunction features include:
>> 
>> Cloud agnostic and decoupled with cloud providers' BaaS
>> Pluggable architecture that allows multiple function runtimes
>> Support both sync and async functions
>> Unique async functions support that can consume events directly from event sources
>> Support generating OCI-Compliant container images directly from function source code.
>> Flexible autoscaling between 0 and N
>> Advanced async function autoscaling based on event sources' specific metrics
>> Simplified BaaS integration for both sync and async functions by introducing Dapr
>> Advanced function ingress & traffic management powered by K8s Gateway API (In Progress)
>> Flexible and easy-to-use events management framework
>> Implementation design
>> 
>> 
>> 
>> 1.     Objectives
>> 
>> Supports using functions in OpenFunction as routing "upstream" via plugins to enable access to Faas functions.
>> 
>> 2.     name
>> 
>> The plugin is named openfunction, and the priority is -1902, ranking after openwhisk
>> 
>> 
>> 
>> 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.
>> 
>> 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.
>> 
>> 
>> 
>> 5.     parameters
>> |
>> 
>> Name
>> 
>> |
>> 
>> Type
>> 
>> |
>> 
>> Required
>> 
>> |
>> 
>> Default
>> 
>> |
>> 
>> Valid Values
>> 
>> |
>> 
>> Description
>> 
>> |
>> |
>> 
>> function_Url
>> 
>> |
>> 
>> String
>> 
>> |
>> 
>> True
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> |
>> 
>> ssl_verify
>> 
>> |
>> 
>> Boolean
>> 
>> |
>> 
>> Fales
>> 
>> |
>> 
>> True
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> |
>> 
>> service_token
>> 
>> |
>> 
>> String
>> 
>> |
>> 
>> False
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> Since openfunction does not require authentication, the token parameter is optional.
>> 
>> |
>> |
>> 
>> timeout
>> 
>> |
>> 
>> Integer
>> 
>> |
>> 
>> 60000ms
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> |
>> 
>> keepalive
>> 
>> |
>> 
>> Boolean
>> 
>> |
>> 
>> False
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> |
>> 
>> keepalive_timeout
>> 
>> |
>> 
>> Integer
>> 
>> |
>> 
>> 60000ms
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> |
>> 
>> keepalive_pool
>> 
>> |
>> 
>> Integer
>> 
>> |
>> 
>> 5
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 
>> 
>> 
>> |
>> 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
>> 
>> 

Re: [DISCUSS]Proposal:support openfunction serverless framework plugin

Posted by shirui zhao <zh...@gmail.com>.
hi,
You are very welcome to join the Apache APISIX community. Before you edit the email and send it, I hope you can make sure that the format of the email is readable. The format of the mail is very bad for me, I found it in the trash. So your email may not be seen by everyone, so can you re-edit your email and make it appear properly?

——
Thanks,
Shirui Zhao

> 2022年7月5日 15:51,CongwangLi <lc...@163.com> 写道:
> 
> 
> 
> Hello everyone, my name is CongwangLi and I am an Open Source Promotion Plan 2022 student working with ZhangChao(tokers).
> 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.
> 
> OpenFunction features include:
> 
> Cloud agnostic and decoupled with cloud providers' BaaS
> Pluggable architecture that allows multiple function runtimes
> Support both sync and async functions
> Unique async functions support that can consume events directly from event sources
> Support generating OCI-Compliant container images directly from function source code.
> Flexible autoscaling between 0 and N
> Advanced async function autoscaling based on event sources' specific metrics
> Simplified BaaS integration for both sync and async functions by introducing Dapr
> Advanced function ingress & traffic management powered by K8s Gateway API (In Progress)
> Flexible and easy-to-use events management framework
> Implementation design
> 
> 
> 
> 1.     Objectives
> 
> Supports using functions in OpenFunction as routing "upstream" via plugins to enable access to Faas functions.
> 
> 2.     name
> 
> The plugin is named openfunction, and the priority is -1902, ranking after openwhisk
> 
> 
> 
> 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.
> 
> 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.
> 
> 
> 
> 5.     parameters
> |
> 
> Name
> 
> |
> 
> Type
> 
> |
> 
> Required
> 
> |
> 
> Default
> 
> |
> 
> Valid Values
> 
> |
> 
> Description
> 
> |
> |
> 
> function_Url
> 
> |
> 
> String
> 
> |
> 
> True
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> |
> 
> ssl_verify
> 
> |
> 
> Boolean
> 
> |
> 
> Fales
> 
> |
> 
> True
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> |
> 
> service_token
> 
> |
> 
> String
> 
> |
> 
> False
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 
> Since openfunction does not require authentication, the token parameter is optional.
> 
> |
> |
> 
> timeout
> 
> |
> 
> Integer
> 
> |
> 
> 60000ms
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> |
> 
> keepalive
> 
> |
> 
> Boolean
> 
> |
> 
> False
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> |
> 
> keepalive_timeout
> 
> |
> 
> Integer
> 
> |
> 
> 60000ms
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> |
> 
> keepalive_pool
> 
> |
> 
> Integer
> 
> |
> 
> 5
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 
> 
> 
> |
> 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
> 
> 


Re:[DISCUSS]Proposal:support openfunction serverless framework plugin

Posted by CongwangLi <lc...@163.com>.


This is the picture of parameters.











At 2022-07-05 15:51:52, "CongwangLi" <lc...@163.com> wrote:
>
>
>Hello everyone, my name is CongwangLi and I am an Open Source Promotion Plan 2022 student working with ZhangChao(tokers).
>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.
>
>OpenFunction features include:
>
>Cloud agnostic and decoupled with cloud providers' BaaS
>Pluggable architecture that allows multiple function runtimes
>Support both sync and async functions
>Unique async functions support that can consume events directly from event sources
>Support generating OCI-Compliant container images directly from function source code.
>Flexible autoscaling between 0 and N
>Advanced async function autoscaling based on event sources' specific metrics
>Simplified BaaS integration for both sync and async functions by introducing Dapr
>Advanced function ingress & traffic management powered by K8s Gateway API (In Progress)
>Flexible and easy-to-use events management framework
>Implementation design
>
> 
>
>1.     Objectives
>
>Supports using functions in OpenFunction as routing "upstream" via plugins to enable access to Faas functions.
>
>2.     name
>
>The plugin is named openfunction, and the priority is -1902, ranking after openwhisk
>
> 
>
>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.
>
>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.
>
> 
>
>5.     parameters
>|
>
>Name
>
>|
>
>Type
>
>|
>
>Required
>
>|
>
>Default
>
>|
>
>Valid Values
>
>|
>
>Description
>
>|
>|
>
>function_Url
>
>|
>
>String
>
>|
>
>True
>
>|
>
> 
>
>|
>
> 
>
>|
>
> 
>
>|
>|
>
>ssl_verify
>
>|
>
>Boolean
>
>|
>
>Fales
>
>|
>
>True
>
>|
>
> 
>
>|
>
> 
>
>|
>|
>
>service_token
>
>|
>
>String
>
>|
>
>False
>
>|
>
> 
>
>|
>
> 
>
>|
>
>Since openfunction does not require authentication, the token parameter is optional.
>
>|
>|
>
>timeout
>
>|
>
>Integer
>
>|
>
>60000ms
>
>|
>
> 
>
>|
>
> 
>
>|
>
> 
>
>|
>|
>
>keepalive
>
>|
>
>Boolean
>
>|
>
>False
>
>|
>
> 
>
>|
>
> 
>
>|
>
> 
>
>|
>|
>
>keepalive_timeout
>
>|
>
>Integer
>
>|
>
>60000ms
>
>|
>
> 
>
>|
>
> 
>
>|
>
> 
>
>|
>|
>
>keepalive_pool
>
>|
>
>Integer
>
>|
>
>5
>
>|
>
> 
>
>|
>
> 
>
>|
>
> 
>
>|
> 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
>
>