You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通过Cloud Build触发器YAML配置Cloud Run健康检查遇参数错误求助

解决Cloud Run服务更新时健康检查参数报错问题

你遇到的unrecognized arguments错误,是因为使用了错误的参数名——--health-check-http-path并不是gcloud run services update命令的合法参数。Cloud Run的健康检查分为启动探针(Startup Probe)、就绪探针(Readiness Probe)、**存活探针(Liveness Probe)**三类,每类探针都有独立的配置参数,需要明确指定探针类型。

修正后的启动探针YAML配置

如果你的目标是配置启动探针,将参数替换为对应探针的专属参数即可:

- name: gcr.io/google.com/cloudsdktool/cloud-sdk
args:
  - run
  - services
  - update
  - $_SERVICE_NAME
  - --startup-probe-startup-delay=60s
  - --startup-probe-http-path=/healthz
entrypoint: gcloud
id: Configure Startup Probe

其他探针的配置参数参考

如果需要配置就绪或存活探针,使用对应的参数:

  • 就绪探针路径:--readiness-probe-http-path=/healthz
  • 存活探针路径:--liveness-probe-http-path=/healthz
  • 探针周期、超时等参数也需要对应前缀,比如--readiness-probe-period=10s、--liveness-probe-timeout=5s

多探针同时配置示例

如果需要一次性配置多个探针,可在args中添加多个参数:

- name: gcr.io/google.com/cloudsdktool/cloud-sdk
args:
  - run
  - services
  - update
  - $_SERVICE_NAME
  - --startup-probe-startup-delay=60s
  - --startup-probe-http-path=/healthz
  - --readiness-probe-http-path=/healthz
  - --readiness-probe-period=10s
entrypoint: gcloud
id: Configure Probes

内容的提问来源于stack exchange,提问作者OtaconKiko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 04:17:36