Connecting MongoDB Atlas to Kubernetes EKS Cluster on AWS

8/26/2019

I'm trying to setup an VPC Peering from my MongoDB Atlas Cluster to my Kubernetes EKS Cluster on AWS. The Peering is established successfully but i get no connection to the cluster on my pod's.

The peering is setup. Peering

The default entry for the whitelist ist added as well. Once the connection works i will replace it with a security Group. IP Whitelist

The peering on AWS is accepted and "DNS resolution from requester VPC to private IP" is enabled. Peering AWS

The route as been added to the Public Route Table of the K8S Cluster. Route AWS

When i connect to a pod and try to establish a connection with the following command:

# mongo "mongodb://x.mongodb.net:27017,y.mongodb.net:27017,z.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --ssl --authenticationDatabase admin --username JackBauer

I get "CONNECT_ERROR" for every endpoint.

What am I missing?

NOTE: I've just created a new paid cluster and the VPC is working perfectly. Might this feature be limited to paid clusters only?

-- Thomas Spycher
amazon-vpc
amazon-web-services
kubernetes
mongodb
mongodb-atlas

1 Answer

8/26/2019

Well... as the documentation states:

You cannot configure Set up a Network Peering Connection on M0 Free Tier or M2/M5 shared clusters.

Peering is not working on shared Cluster. Which makes, after i think about it, totally sense.

-- Thomas Spycher
Source: StackOverflow