Search code examples
google-cloud-platformgoogle-compute-enginegce-instance-group

How do you add health checks on instance-groups using gcloud?


The only way I see to add a health check to an instance group is to create an instance pool then add the health check. Is there any way to directly add the health check to the instance group? The create and autoscaling gcloud group don't have anything.


Solution

  • When setting autoscaling, you can either scale based on load balancing (where your load balancer should have health check configured) or based on cpu utilization. There is no way to set health check directly for instance group for auto scaling.

    You can associate a health check with a managed instance group directly when configuring auto healing: https://cloud.google.com/sdk/gcloud/reference/alpha/compute/instance-groups/managed/set-autohealing