When publishing your application for external access, you can configure global load balancing for it so that user requests are load balanced across multiple clusters in one or multiple zones or regions. With global load balancing, you can achieve high availability of your application.
A general practice for achieving high availability is to deploy an application in more than one cluster and position a global load balancer between them to direct north-south traffic to the frontend services deployed on these clusters.
In Tanzu Service Mesh, you can publish your application to external clients through a public service by using a global namespace and the integrations of Tanzu Service Mesh with AWS Route 53 or NSX Advanced Load Balancer (formerly AVI Networks). AWS Route 53 or NSX Advanced Load Balancer provides domain name system (DNS) and global service load balancing (GSLB) capabilities. A public service is an HTTP or HTTPS service that you expose externally from a global namespace. When configuring a public service, you specify one or more DNS fully qualified domain names (FQDNs) for the public service to designate them as the public URLs. A public URL is an URL at which the public service is exposed to external clients. You then provide a global load balancing configuration for each public URL of the public service. Tanzu Service Mesh distributes the traffic to the service instances according to the global load balancing configuration.
As part of the global load balancing configuration, you must select a global load balancing scheme for each public URL of the public service. You can choose between a round robin, weighted, or active-passive global load balancing scheme.
The round robin algorithm distributes user requests equally among the healthy service instances by forwarding requests to each instance in turn.
The weighted load balancing algorithm splits traffic to the service into percentage-based portions according to relative service weights. The traffic percentages are calculated according to the formula: a service weight divided by the sum of all of the service weights. For example, if you assign a service instance a weight of 20 and give other two instances a weight of 10, the load balancing algorithm will compute that 50% of the traffic goes to the first instance, and 25% of the traffic is sent to each of the other two instances. To define weights for the public service, you must add a weight label to the service configuration on each cluster where the service is deployed and then associate these predefined weight labels with the appropriate weight values in the UI. A percentage of the traffic will be routed to a specific public service instance based on the weight value associated with the weight label that is defined for that instance in its service configuration.
With the active-passive scheme, you can configure a failover routing policy by defining active and passive groups of service instances. Traffic is routed to the active group until at least one instance in the active group is healthy. If health checks determine that all the active instances are unhealthy, the load balancing algorithm fails over to the instances in the passive group. To configure active and passive groups, you must add an active group label or a passive group label to the service configuration on each cluster where the service is deployed and then select these predefined labels for the active and passive groups respectively in the UI. A specific public service instance is assigned to the active group or passive group based on whether the active group label or passive group label is defined in its service configuration.
You additionally define a group load balancing scheme, round robin or weighted, for the service instances within the active group and the passive group. Round robin is selected by default. For example, if you specify a group load balancing scheme of round robin for the passive group and if all the active group instances are unhealthy, the traffic will be rotated through the passive group instances according to the round robin algorithm.
You also configure health checks in the global load balancing configuration. Tanzu Service Mesh uses the specified health-check settings to periodically check whether the public service is reachable and functional. If health checks determine that a service instance is unhealthy, Tanzu Service Mesh routes traffic to other instances according to the configured global load balancing scheme. You can use the default health-check settings or define custom settings.
Prerequisites
Create an Avi integration Account or an Amazon Web Services (AWS) integration account, depending on you use NSX Advanced Load Balancer or Amazon Route 53 for domain name system (DNS) routing and global load balancing.
Procedure
What to do next
You can view the global load balancing configuration of the public service on the Configuration tab of the public service details page. For more information, see Monitor a Public Service.
You can edit the global load balancing configuration from the public service details page. For more information, see Edit the Configuration of a Public Service.
You can view the information about how traffic is routed to the different public URLs of the public service, including the service-level metrics like requests per second (RPS), on the GSLB Routing tab of the public service details page. For more information, see Monitor a Public Service.