0

I'm trying to connect an already existing GKE cluster to a Mongo Cluster in mongo atlas.

I followed this tutorial, with the only difference that I didn't create the GKE cluster after creating the peering, but the other way around: I created the GKE Cluster, and then, when I saw I needed the peering, I peered the VPC in which the GKE Cluster was deployed, to mongo.

Then I tried the following

kubectl run -i --tty mongo-test --image=mongo --restart=Never -- sh

and then mongosh <<myconnectionurl>>, but it fails with a timeout.

I fear the peering needs to be done BEFORE creating the GKE cluster, which would be extremely undesirable for me. Note that VPC-native traffic routing is enabled in said GKE Clustter.

caeus
  • 3,084
  • 1
  • 22
  • 36
  • 1)Check the Firewall was blocking access to port 27017. 2) Try doing this:- MongoDB Atlas -> NetworkAccess -> Edit -> Allow Any. 3) Check this [VPC Peering Between MongoDB Atlas and Google Cloud](https://levelup.gitconnected.com/vpc-peering-between-mongodb-atlas-google-cloud-eec89a261b75) for more info, the above actions may help to resolve your issue. – Veera Nagireddy Jan 24 '23 at 12:37
  • @VeeraNagireddy, Do Mongo Atlas have a firewall? if so, how do I check it? Network Access section doesn't have an Edit option/button... I'm checking the tutorial you created – caeus Jan 24 '23 at 15:39
  • Tutorial helps to resolve your issue? – Veera Nagireddy Jan 24 '23 at 17:00
  • Nope, sorry. I think the limitation I'm facing is the fact that VPC Peering is not supported for applications hosted in GCP, and mongo atlas clusters hosted in AWS (https://www.mongodb.com/docs/atlas/security-vpc-peering/#set-up-a-network-peering-connection) – caeus Jan 24 '23 at 17:02
  • Try this tutorial [Connect a GKE Cluster with MongoDB Atlas through Cloud NAT](https://dchaykin.medium.com/connect-a-gke-cluster-with-mongodb-atlas-through-cloud-nat-b0ffb2683b7d). – Veera Nagireddy Jan 24 '23 at 17:09
  • can you please share the complete error details? – Veera Nagireddy Jan 24 '23 at 17:16

0 Answers0