How do I setup zone aware routing?
There are several steps required for enabling zone aware routing between source service (“cluster_a”) and destination service (“cluster_b”).
Envoy configuration on the source service
This section describes the specific configuration for the Envoy running side by side with the source service. These are the requirements:
Envoy must be launched with
--service-zone
option which defines the zone for the current host.Both definitions of the source and the destination clusters must have sds type.
local_cluster_name must be set to the source cluster.
Only essential parts are listed in the configuration below for the cluster manager.
{
"sds": "{...}",
"local_cluster_name": "cluster_a",
"clusters": [
{
"name": "cluster_a",
"type": "sds",
},
{
"name": "cluster_b",
"type": "sds"
}
]
}
Envoy configuration on the destination service
It’s not necessary to run Envoy side by side with the destination service, but it’s important that each host in the destination cluster registers with the discovery service queried by the source service Envoy. Zone information must be available as part of that response.
Only zone related data is listed in the response below.
{
"tags": {
"az": "us-east-1d"
}
}
Infrastructure setup
The above configuration is necessary for zone aware routing, but there are certain conditions when zone aware routing is not performed.
Verification steps
- Use per zone Envoy stats to monitor cross zone traffic.