Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect multiple cloud with overlapping VPC?

We are creating a Console to administer, view logs and metrics, create resources on Kubernetes in a multicloud environment.
The Console ( a web app ) is deployed on GKE in GCP, but we can't figure out how we can connect and reach K8S Api-Servers in multiple VPC with overlapping IPs, without exposing them on public IP.
I draw a little diagram to expose the problem.

enter image description here

Are there some products or best practice to perform this securely?
Product vendors for example Mongo Atlas or Confluent Cloud seems to have solved this issue, they can create infrastructure in multiple cloud and administer them.

like image 664
Thomas8 Avatar asked Oct 20 '20 08:10

Thomas8


1 Answers

It's not possible to connect two overlapping networks with VPN even if they're in different clouds (GCP & AWS).

I'd suggest to use NAT translation on both sides and connect networks using VPN. Here's some documentation that may help you. Unfortunatelly it's quite a bit of reading and setting up. Not the easiest solution but it has the benefit of being reliable and it's a quite old and tested approach.

General docs

  • Configure NAT to Enable Communication Between Overlapping Networks
  • Using NAT in Overlapping Networks

GCP side

  • Cloud NAT overview
  • Using Cloud NAT

AWS side

  • NAT instances
  • Comparison of NAT instances and NAT gateways

You second option is to split the original networks in smaller chunks so they wold not overlap but that's not always possible (due to network being small enough already and many IP's are used up...).

like image 156
Wojtek_B Avatar answered Oct 02 '22 04:10

Wojtek_B