Search code examples
google-compute-enginegoogle-deployment-manager

How to create Regional Health checks with Google Deployment Manager


I am trying to create a regionBackendService using Google Deployment Manager. The problem is I can't find a way to create a regional health check that the regionBackendService accepts.

This is my latest attempt:

  - 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

Unluckily but expectedly, this leads to the following error:

NetLB supports regional health checks only

In fact, I should be creating a compute.v1.RegionalHealthCheck as clearly stated in the documentation.

Unluckily, Deployment Manager doesn't seem to support such object.

Any ideas?


Solution

  • I found out that, despite it not being listed within supported types, it is possible to create a regional health check by using the compute.v1.regionHealthChecks (yes, plural) type.

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

    So it looks like a problem in the documentation or me not finding it.