Search code examples
google-cloud-platformload-balancinggoogle-cloud-load-balancer

Instance Group signed to more than one backend services


In Google Cloud Platform, we have a feature called as Load Balancing.

When i use load balancing, i get a problem when i sign an Instance Group to more than one backend services.

GCLB (1) -> Backend Service (A-bs) -> Instance Group (alice-4df1-a) with port (30001)

And then i have another backend service got signed by same Instance group

GCLB (1) -> Backend Service (B-bs) -> Instance Group (alice-4df1-a) with port (30002)

After some minutes, the Backend Service (A-bs)'s port changes from (30001) to (30002).

If i signed other Instance Group like this

GCLB (1) -> Backend Service (B-bs) -> Instance Group (alice-4df1-B) with port (30002)

The Backend Service (A-bs) will stay with port (30001).

The conclusion is 1 Instance Group can only be signed to 1 Backend service with 1 port.

Is my conclusion true ? Can someone explain or give me a documentation relate to this one please ? Thank you very much


Solution

  • In the case of using instance group as a backend for Load Balancer, unmanaged instance group is a collection of virtual machines (VMs) that reside in a single zone, VPC network, and subnet. An unmanaged instance groups is useful for grouping together VMs that require individual configuration settings or tuning.

    About the ports, each instance group can have multiple named ports. A named port creates a mapping from a service name to a port number. If an instance group's named port matches the named port to which the backend services subscribes, the named port mapping on the instance group is used to define the port number that the backend service uses for communication with the group's member VMs.

    But, there are some important things to note:

    1.- Each backend service subscribes to a single port name. Consequently, each of its backend instance groups must have at least one named port for that name.

    2.- It is possible for a backend service to use a different port number when communicating with VMs in different instance groups if each instance group specifies a unique port number for the same port name.

    3.- The resolved port number used by the backend service does not have to match the port number used by the load balancer's forwarding rule(s).

    And Also, there are some restrictions about it.

    So, Load balancers that act as proxies subscribe to a single named port in their backend service configuration. The port's name is translated to a port number based on the named ports mapping of each instance group backend.