OpenFaas使用Go模板创建Function
根据模板创建项目
# 登录openfaas
faas-cli login https://gateway-openfaas.netwarps.com -p xxxx
# 查看已经存在的function列表
faas-cli list
# 拉取语言模板
faas-cli template pull
# 根据默认go模板创建function项目
faas-cli new -p registry.solarfs.io/go-test go-test2 --lang gogo-test2
go-test2.ymlversion: 1.0
provider:
name: openfaas
gateway: https://gateway-openfaas.netwarps.com
functions:
go-test2:
lang: go
handler: ./go-test2
image: registry.solarfs.io/go-test/go-test2:latest
secrets: # 这个是手动添加的,配置镜像imagePullSecret
- registry-pld-cicd # imagePullSecret name思考
减少代码量
自动扩容
参考
Last updated