无法将HTTP运行状况检查附加到gcloud(cli)上的https后端服务

时间:2018-07-20 14:02:18

标签: gcloud internal-load-balancer

是否可以在创建后端服务(https)的过程中将其附加到http运行状况检查?

我之所以这样问是因为,如果我手动尝试该操作(谷歌云网络控制台),我就能做到。

我的脚本如下:

gcloud compute http-health-checks create my-health-check --port 80 \
--host <my host goes here> \
--project "$PROJECT"`enter code here`

gcloud compute backend-services create my-bs \
--http-health-checks my-health-check \
--protocol HTTPS \
--timeout 5m \
--project "$PROJECT" \
--global

然后出现以下错误:

This HTTPS/HTTP2 backend service supports HealthCheck and HttpsHealthCheck

但是,如果我手动创建它,则Google(网络控制台)允许我。

1 个答案:

答案 0 :(得分:1)

我找到了解决方法:

gcloud compute health-checks create http my-health-check --port 80 --host my-url --project "$PROJECT" 

gcloud compute backend-services create bs --health-checks my-health-check --protocol HTTPS --timeout 5m --project "$PROJECT" --global