我在Google Cloud Deployment中有点新手,但是我目前正在尝试在Google Cloud Deployment Manager中使用yaml设置外部http负载均衡器。负载平衡器使用运行状况检查,但是当我尝试重定向到运行状况检查所在的位置时,会出现一个找不到它的错误。
我尝试在控制台中手动创建运行状况检查,但仍然显示找不到。
我在https://cloud.google.com/compute/docs/reference/rest/v1/backendServices和https://cloud.google.com/compute/docs/reference/rest/v1处浏览了文档/ healthChecks,它似乎应该可以工作,但是不起作用。
我也在google上搜索并在堆栈溢出中找到了答案,但没有找到任何东西。我还尝试使用自链接链接到运行状况检查。但这也不起作用。我觉得我在这里想念什么。
- name: healthcheckpls
type: compute.v1.httpHealthCheck
properties:
port: 80
requestPath: /
- name: bes
type: compute.v1.backendService
properties:
port: 80
portName: http
protocol: HTTP
backends:
- name: bes
balancingMode: UTILIZATION
capacityScaler: 1.0
group: zones/us-central1-f/instanceGroups/instancegroup-1
maxUtilization: 0.8
connectionDraining:
drainingTimeoutSec: 300
healthChecks:
- global/httpHealthChecks/healthcheckpls
- name: apache-url-map
type: compute.v1.urlMap
properties:
defaultService: $(ref.bes.selfLink)
- name: apache-http-proxy
type: compute.v1.targetHttpProxy
properties:
urlMap: $(ref.apache-url-map.selfLink)
- name: apache-ipaddress
type: compute.v1.globalAddress
- name: apache-http-forwardingrule
type: compute.v1.globalForwardingRule
properties:
target: $(ref.apache-http-proxy.selfLink)
IPAddress: $(ref.apache-ipaddress.address)
IPProtocol: TCP
portRange: 80-80
这是我从部署管理器中收到的错误。
ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation [operation-1606653109305-5b53e13db7fbd-7084e34a-f0444d0f]: errors:
- code: RESOURCE_ERROR
location: /deployments/lampdeployment/resources/bes
message: "{\"ResourceType\":\"compute.v1.backendService\",\"ResourceErrorCode\"\
:\"404\",\"ResourceErrorMessage\":{\"code\":404,\"errors\":[{\"domain\":\"global\"\
,\"message\":\"The resource 'projects/cloudautomation-296812/global/httpHealthChecks/healthcheckpls'\
\ was not found\",\"reason\":\"notFound\"}],\"message\":\"The resource 'projects/cloudautomation-296812/global/httpHealthChecks/healthcheckpls'\
\ was not found\",\"statusMessage\":\"Not Found\",\"requestPath\":\"https://compute.googleapis.com/compute/v1/projects/cloudautomation-296812/global/backendServices\"\
,\"httpMethod\":\"POST\"}}"
我想念什么吗?为什么这不起作用?
我对此很陌生,所以如果有什么根本性的缺失,我也想知道:D
感谢你的帮助!对此,我真的非常感激。
经过大量的故障排除后,我明白了。我不得不使用:
healthChecks:
- $(ref.healthcheckpls.selfLink)