High level design
wiki.example.comto connect to the front-end web app over Interconnect or VPN. The geo-location policy will use the Google Cloud region where the Interconnect or VPN lands as the source for the traffic and look for the closest available endpoint.
DNS resolution based on the location of the user
DNS resolution based on the location of the user and health of ILBs backends
wiki.example.comrecord provides us with automatic failover in case of a failure and ensures that Cloud DNS always returns only the healthy endpoints in response to the client queries. This removes manual intervention and significantly improves the failover time.The Cloud DNS routing policy configuration would look like this:Creating the Cloud DNS managed zone:
gcloud dns managed-zones create wiki-private-zone \ --description="DNS Zone for the front-end servers of the wiki application" \ --dns-name=wiki.example.com \ --networks=prod-vpc \ --visibility=private
gcloud dns record-sets create front.wiki.example.com. \ --ttl=30 \ --type=A \ --zone=wiki-private-zone \ --routing-policy-type=GEO \ --routing-policy-data="us-west2=us-ilb-forwarding-rule;europe-west1=eu-ilb-forwarding-rule;asia-northeast1=asia-ilb-forwarding-rule" \ --enable-health-checking
backend.wiki.example.com.The Cloud DNS geo-location policy with health checks will use the front-end servers’ GCP region information to resolve this hostname to the closest available healthy back-end tier Internal Load Balancer.
Front-end to back-end communication (instance to instance)
By: Truptesh Nagesh (Network Specialist, Google Cloud) and Paarth Mahajan (Network Specialist, Google Cloud)
Source: Google Cloud Blog