$ kn func create -r <repository> -l <runtime> -t <template> <path>
Before you can build and deploy a function, you must create it. You can create functions using the Knative (kn
) CLI.
Before you can build and deploy a function, you must create it by using the Knative (kn
) CLI. You can specify the path, runtime, template, and image registry as flags on the command line, or use the -c
flag to start the interactive experience in the terminal.
The OpenShift Serverless Operator and Knative Serving are installed on the cluster.
You have installed the Knative (kn
) CLI.
Create a function project:
$ kn func create -r <repository> -l <runtime> -t <template> <path>
Accepted runtime values include quarkus
, node
, typescript
, go
, python
, springboot
, and rust
.
Accepted template values include http
and cloudevents
.
$ kn func create -l typescript -t cloudevents examplefunc
Created typescript function in /home/user/demo/examplefunc
Alternatively, you can specify a repository that contains a custom template.
$ kn func create -r https://github.com/boson-project/templates/ -l node -t hello-world examplefunc
Created node function in /home/user/demo/examplefunc