cross-region k8s inter-cluster communication in GCP

6/8/2018

I am looking for a way to access services/applications in a remote k8s cluster(C2) hosted in a different region(R2) from a client application in my current cluster(C1 in region R1).

  1. Server application needs to load-balanced(fqdn preferred over IP)
  2. Communication is through private network, no internet

I tried using an internal-LB for C2 which doesn't work and later realized it to be a regional product. Moreover, it seems, the same constraint is true for vpc peering also.
Please suggest how to achieve this.

-- kronjob
google-cloud-platform
google-kubernetes-engine

1 Answer

6/15/2018

You can't use any internal GCP LB on a regional level. However, you may be able to use an Nginx internal ingress as it may not be limited to the same region.

Otherwise you can use Creating VPC-native clusters using Alias IPs which can allow you to call on pods directly. It will not offer built in load balancing but it is an alternative.

Finally, if you need to use the internal load balancers, you can create a VPN tunnel between the two regions and create a route that forces traffic through the gateway. Traffic coming through the tunnel will be regional to the ILB, but this config is more expensive and with more moving parts, there's a higher chance of failure

-- Patrick W
Source: StackOverflow