01 Sign in to Google Cloud Management Console.
02 Select the GCP project that you want to access from the console top navigation bar.
03 Navigate to Google Compute Engine dashboard at https://console.cloud.google.com/compute.
04 In the navigation panel, select Instance groups to access the list with the VM instance groups created for the selected project.
05 Click inside the Filter resources box, select Group type and google.internal.cloud.console.clientapi.gce.mig.instancegrouptype.managed to list only the Managed Instance Groups (MIGs) available within the selected project.
06 Click on the name of the MIG resource that you want to reconfigure, and choose EDIT GROUP to access the instance group editing page.
07 Under Autohealing, select Create a health check from the Heath check dropdown list to initiate the setup process.
08 On the MIG heath check setup panel, perform the following actions:
- In the Name box, give the new health check resource a unique name.
- (Optional) For Description, provide a short and concise description for the health check.
- For Protocol, make sure that HTTP is selected.
- For Port, use port 80.
- For Proxy protocol, make sure that NONE is selected.
- For Request path, enter the path of the HTTP health check request. The default is /.
- Under Health criteria, use the Check interval field to configure how often (in seconds) to send a health check. The default is 10 seconds.
- For Timeout, configure how long to wait (in seconds) before a request is considered a failure. The default is 5 seconds.
- For Healthy threshold, set a healthy threshold (number) in order to determine how many consecutive successful health checks must be returned before an unhealthy virtual machine is marked as healthy. The default is 2.
- For Unhealthy threshold, configure an unhealthy threshold (number) to determine how many consecutive unsuccessful health checks must be returned before a healthy VM instance is marked as unhealthy. The default is 3.
- Click Save and continue to create the health check resource and associate it with the selected instance group.
09 For Initial delay, set the time to allow an instance to boot and applications to fully start before the first health check. This setting delays autohealing from potentially prematurely re-creating the virtual machine if the VM is in the process of starting up.
10 Click Save to apply the configuration changes.
11 Health check probes come from IPv4 addresses in the ranges 130.211.0.0/22 and 35.191.0.0/16, therefore make sure that your network firewall rules allow the health check to connect. If TCP port 80 (HTTP) is not already open in the network firewall associated with the selected instance group, perform the following actions to create the required firewall rule:
- Navigate to VPC Network dashboard at https://console.cloud.google.com/networking.
- In the navigation panel select Firewall and choose CREATE FIREWALL RULE to create a new firewall rule.
- On the Create a firewall rule setup page, perform the following:
- For Name, enter a unique name for the firewall rule (e.g. allow-health-check).
- For Description, provide a short description for the new rule.
- Select the VPC network associated with the reconfigured instance group from the Network dropdown list.
- From Targets dropdown list, choose All instances in the network if you don’t have target tags configured.
- Select IP ranges from the Source filter dropdown list.
- For Source IP ranges, enter 130.211.0.0/22 and 35.191.0.0/16.
- In Protocols and ports section, choose Specified protocols and ports, select tcp, and enter 80 in the tcp port box.
- Click CREATE to create the required firewall rule.
12 Repeat steps no. 6 – 11 to reconfigure other Managed Instance Groups (MIGs) available in the selected GCP project.
13 Repeat steps no. 2 – 12 for each GCP project created within your Google Cloud account.