0

I am using GCP and have a created a GCP load balancer to load balance across 3 docker instances running on one VM. The instances are running on ports 8080, 8081 and 8082. When creating the load balancer health check in the UI console, it asks for the port number for the health check (see screenshot). I can use 8080 but I want the health check to check each port of the instances to see if the service is healthy. This will allow me to stop and start the docker instances without affecting the service.

Any pointers or advice on how to do this?

enter image description here

Swordfish
  • 1,127
  • 24
  • 46

2 Answers2

1

Mapping multiple ports to a single health check is currently unavailable. You can open a feature request here. In the meantime, you need to create health check for each port.

Wilfred L.
  • 176
  • 5
0

As a workaround :

  1. Define all ports you want to forward to the backend in instance groups settings.

  2. Create different load balancer backends for each different ports in instance group.

  3. map each backend to different domain/subdomain in load balancer settings.

GCP Load balancer deployment takes a few minutes. You might not able to see the changes immediately

Neelam
  • 517
  • 4
  • 10