OpenFunction is a cloud-native open source FaaS (Function as a Service) platform aiming to enable users to focus on their business logic without worrying about the underlying runtime environment and infrastructure. Users only need to submit business-related source code in the form of functions.
OpenFunction features but not limited to the following:
- Convert business-related function source code to runnable application source code.
- Generate a deployable container image from the converted application source code.
- Deploy the generated container image to the underlying runtime environment such as K8s, and automatically scale up and down according to business traffic, and scale to 0 when there is no traffic.
- Provide event management functions for trigger functions.
- Provide additional functions to manage function versions, ingress management etc.
OpenFunction manages resources in the form of CustomResourceDefinitions (CRD) during the lifecycle of a function. You can learn more about it by visiting Components or Concepts.
The following versions are supported and work as we test against these versions in their respective branches. But note that other versions might work!
| OpenFunction | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20+ |
|---|---|---|---|---|
release-0.3 |
√ | √ | √ | √ |
release-0.4 |
√ | √ | √ | √ |
HEAD |
√ * | √ * | √ | √ |
*Note: OpenFunction added the function ingress feature after release-0.4, which means that:
- You have to install OpenFunction in Kuberenetes v1.19 or higher if you enable this feature.
- You can still use OpenFunction in Kubernetes v1.17~v1.20+ without this feature enabled.
Now you can use ofn, the CLI of OpenFunction, to install and uninstall OpenFunction and its dependencies.
Visit ofn release to select the ofn cli to deploy to your cluster.
After that you can install OpenFunction with one command:
ofn install --all
For more information about ofn install, please refer to ofn install docs.
If you have already installed the OpenFunction platform, refer to OpenFunction samples to find more samples.
Here is an example of a sync function.
This function will write "Hello, World!" to the HTTP response.
package hello
import (
"fmt"
"net/http"
)
func HelloWorld(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, World!\n")
}And an async function example.
This function will receive a greeting message and then send it to "another-target".
package bindings
import (
"encoding/json"
"log"
ofctx "github.com/OpenFunction/functions-framework-go/openfunction-context"
)
func BindingsOutput(ctx *ofctx.OpenFunctionContext, in []byte) ofctx.RetValue {
log.Printf("receive greeting: %s", string(in))
_ := ctx.Send("another-target", in)
return 200
}You can also use ofn to make a quick demo:
By default the demo environment will be deleted when the demo finishes. You can keep the demo kind cluster for further exploration by
ofn demo --auto-prune=falseThe demo kind cluster can be deleted bykind delete cluster --name openfunction
ofn demoFor more information about ofn install, please refer to ofn demo docs.
Use ofn to uninstall OpenFunction and its dependencies:
ofn uninstall --allFor more information about ofn install, please refer to ofn uninstall docs.
You can get help on developing this project by visiting Development Guide.
Here you can find OpenFunction's roadmap.
Meeting Info: Zoom
Meeting Time: Wednesday at 15:30~16:30 Beijing Time (biweekly, starting from June 23rd, 2021) Meeting Calendar
- Slack #sig-serverless
