部署 deploy
更新時間 2025-09-15 12:04:47
最近更新時間: 2025-09-15 12:04:47
分享文章
deploy命令將YAML文件描述的函數資源部署到函數計算。
參數解析
無。
操作案例
進入到資源描述文件(s.yaml)所在的路徑,然后執行如下命令部署資源:
s deploys.yaml文件示例:
edition: 3.0.0
name: hello-devsapp
access: default
vars:
region: "bb9fdb42056f11eda1610242ac110002"
resources:
my-func:
component: faas-cf # 組件,提供具體的業務能力。faas-cf 組件提供了對天翼云Serverless函數的管理能力
props:
region: ${vars.region} # 部署的資源池,天翼云華東1資源池為 bb9fdb42056f11eda1610242ac110002
functionName: hello-world # 函數名稱
code: ./code # 函數代碼目錄
createType: 1 # 函數類型:標準函數(1)、自定義函數(2)、容器函數(3)
runtime: # 函數運行配置
handleType: event # 處理事件請求(event)、處理HTTP請求(http)
handler: index.handler # 請求處理程序
runtime: python3.10 # 運行環境
executeTimeout: 64 # 執行超時時間
instanceConcurrency: 1 # 實例并發度
container: # 運行容器配置
memorySize: 512 # 內存規格,單位:MB
cpu: 0.5 # vCPU規格,單位vCPU
diskSize: 512 # 臨時硬盤大小,單位:MB
timeZone: UTC # 時區,例如:UTC, Asia/Shanghai執行完成輸出示例:
functionId: 39061695070521915
code:
ossBucketName:
ossObjectName: function/******
snapshotOssObjectName:
zipFile:
container:
image: faas-******/python3.10-runtime:v1.3.1
timeZone: UTC
memorySize: 512
cpu: 0.5
diskSize: 512
runCommand: Li9ib290c3RyYXAuc2g=
listenPort: 8080
codeDirPath: /code
logLevel:
sysLogLevel: INFO
maxScale: null
minScale: null
fastStart: 0
functionName: hello-world
...