mirror of https://github.com/knative/func.git
|
|
||
|---|---|---|
| appsody | ||
| buildpacks | ||
| cmd | ||
| docker | ||
| embedded | ||
| k8s | ||
| kn | ||
| knative | ||
| kubectl | ||
| mock | ||
| progress | ||
| prompt | ||
| templates | ||
| testdata | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| client.go | ||
| client_test.go | ||
| client_unit_test.go | ||
| config.go | ||
| function.go | ||
| function_unit_test.go | ||
| go.mod | ||
| go.sum | ||
| pkged.go | ||
README.md
faas
Function as a Service CLI
Setup and Configuration
With Go 1.13+ installed, build and install the binary to your path:
go install
Install dependent binaries:
appsodyhttps://appsody.dev/docs/installing/installing-appsodyknhttps://github.com/knative/client/releaseskubectlhttps://kubernetes.io/docs/tasks/tools/install-kubectl/dockerhttps://docs.docker.com/get-docker/
Configure Boson appsody stack repository:
appsody repo add boson https://github.com/boson-project/stacks/releases/latest/download/boson-index.yaml
Configure Image repository:
Both the image repository and user/org namespace need to be defined either by
using the --registry and --namespace flags on the create command, or by
configuring as environment variables. For example to configure all images
to be pushed to quay.io/alice, use:
export FAAS_REGISTRY=quay.io
export FAAS_NAMESPACE=alice
Cluster connection:
It is expected that kubectl and kn be configured to connect to a kubernetes cluster with the following configuration:
- Knative Serving and Eventing
- Knative Domains patched to enable your chosen domain
- Knative Network patched to enable subdomains
- Kourier
- Cert-manager
see https://github.com/boson-project/config for cluster setup and configuration details.
Usage
See help:
faas
Examples
Create a new Function:
> mkdir -p example.com/www
> cd example.com/www
> faas create go
https://www.example.com
> curl https://www.example.com
OK