openfaas
26 Oct 2020Install and deploy 1
# initial docker swarm
docker swarm init
docker node ls
# get openfaas source code
git clone https://github.com/openfaas/faas
cd faas
# deploy
./deploy_stack.sh --no-auth
# test
faas-cli secret list --gateway http://127.0.0.1:8080
faas-cli store list --platform armhf
faas-cli store list
faas-cli list
faas-cli store deploy figlet
faas-cli list
Command invoke 2
$ echo "OpenFaaS!" | faas-cli invoke figlet
___ _____ ____ _
/ _ \ _ __ ___ _ __ | ___|_ _ __ _/ ___|| |
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \| |
| |_| | |_) | __/ | | | _| (_| | (_| |___) |_|
\___/| .__/ \___|_| |_|_| \__,_|\__,_|____/(_)
|_|
Function example
faas-cli new --lang python hello-python
faas-cli build -f ./hello-python.yml
faas-cli deploy -f ./hello-python.yml
echo "OpenFaaS!" | faas-cli invoke hello-python
curl -X POST --data "hello world" http://127.0.0.1:8080/function/hello-python