Load-balanced access to services running on virtual nodes/containers within a cluster is
supported as shown here:
This example shows a virtual cluster that consists of two virtual nodes/containers, where:
- Services A and B are running on both virtual nodes and are configured for
load-balancing.
- Service C is running on both virtual nodes but is not configured for load-balancing.
In this example, this service consumes two externally visible Gateway
ports (10003 and 10004).
- Service D is only running on Virtual node 1.
- Service E is only running on Virtual node 2.
In this example:
- The Gateway host will assign all requests made to port 10001 to the instance of
Service A that is running on either Virtual node 1 or Virtual node 2, on a
round-robin basis. This means that if the previous request to port 10001 was routed
to Virtual node 1, then the next request to that port will be routed to Virtual node
2, and vice-versa.
- The Gateway host will assign all requests made to port 10002 to the instance
of Service B that is running on either Virtual node 1 or Virtual node 2, on a
round-robin basis, as described above.
- Any request made to Gateway port 10003 will be routed to the instance of Service C
that is running on Virtual node 1 because this service is not configured for
load-balancing.
- Any request made to Gateway port 10004 will be routed to the instance of
Service C that is running on Virtual node 2 because this service is not configured
for load-balancing.
There are two ways to use load balancing:
- Automatic: If at least one Gateway host is present, then you can create a
virtual cluster using an App Store image that includes one or more services that are
flagged for load-balancing. The Gateway host will map all running instances of each
load-balanced service to a single Gateway port, as described above. See Gateway Hosts and Creating a New Cluster.
- Manual: If at least one Gateway host is present, then you can manually add a
service that supports load balancing as described in Adding a Cluster Service. No check occurs to
determine whether a manually-added service actually supports load-balancing.