如何使用 Google Deployment Manager 创建区域健康检查

How to create Regional Health checks with Google Deployment Manager

我正在尝试使用 Google Deployment Manager 创建一个 regionBackendService。 问题是我找不到创建 regionBackendService 接受的 regional health check 的方法。

这是我最近的尝试:

  - name: "api-healthcheck"
    type: compute.v1.healthCheck
    properties:
      name: "api-healthcheck"
      region: europe-west3
      type: "HTTP"
      httpHealthCheck:
        port: 8089
        requestPath: '/healthz'
  - name: "api-backend-service"
    type: "compute.v1.regionBackendService"
    metadata:
      dependsOn:
        - api-healthcheck
    properties:
      name: "api-backend-service"
      region: europe-west3
      backends:
        - group: https://www.googleapis.com/compute/v1/projects/...(points to a instance group)
      health checks:
        - $(ref.api-healthcheck.selfLink)
      protocol: TCP
      loadBalancingScheme: EXTERNAL

不幸但意料之中的是,这会导致以下错误:

NetLB supports regional health checks only

事实上,我应该创建一个 compute.v1.RegionalHealthCheck,正如 the documentation 中明确说明的那样。

不幸的是,Deployment Manager doesn't seem to support such object.

有什么想法吗?

我发现,尽管它没有在支持的类型中列出,但可以使用 compute.v1.regionHealthChecks(是的,复数)类型创建区域健康检查。

- name: "api-healthcheck"
    type: compute.v1.regionHealthChecks
    properties:
      name: "api-healthcheck"
      region: europe-west3
      type: "HTTP"
      httpHealthCheck:
        port: 8089
        requestPath: '/healthz'

所以它看起来像是文档中的问题或者我没有找到它。