Network Peering to GKE Routes Based Cluster

I am trying to connect my GCP VPC to my MongoDB Cluster through network peering. But it is not working as I expected. I have implemented network peering in multiple environment and it was successful, but not in this specific GKE. The only difference I can see is this GKE does not support VPC native routing, it is routes based cluster. I think network peering is successful, so which IP should I whitelist in atlas?

There are 3 routes mentioned as “rejected by peer configuration” in my VPC network peering tab in GCP VPC. These are static routes and these are the routes to my nodes. So I doubt this is the reason, is there any way to resolve this. Because I can’t enable GKE VPC native routing without deleting the cluster, which is impossible.

Hey Subin,

Reading through the VPC peering docs, it appears that:

By default, VPC Network Peering with GKE is supported when used with IP aliases. If you don’t use IP aliases, you can export custom routes so that GKE containers are reachable from peered networks.

Based on your description, it sounds like you are not able to leverage IP aliases?


1 Like

I do export the custom routes, but it is shown as “rejected by peer”. I think it doesn’t work with routes based cluster. I can’t recreate the cluster since it is in a high availability state. If you have any workarounds, please do reply.