MongoDB Atlas Connection Timeout from LKE
Hello!
I'm trying to connection to a MongoDB Atlas Database from my LKE Cluster.
Looks like something at Linode side because is blocking the connection, for testing puporses, my MongoDB Atlas is accepting connecitions from everywhere.
I can connect to it from my local computer and from another Kubernetes Cluster hosted Azure using the same connection string without any issues.
Already tried some variations of the connectionstring like mongodb+srv://, mongodb:// using dns names, mongodb:// using ip for for each replica.
Any guidance to help me to figure this out would be appreciated!
Thanks!
1 Reply
Are you getting a specific error when attempting to connect? What kind of pod are you trying to connect from?
As you have likely seen, the MongoDB Atlas Kubernetes Connection Documentation has clear instructions for AWS, GCP, and Azure although LKE is not listed. However, in the screenshot I can see a link for "Troubleshooting Documentation". Have you checked that for solutions?
This post from Stack Overflow titled node.js - MongoDB Atlas not connecting from Kubernetes offers the potential solution of changing the nameserver of your host from the default to 8.8.8.8
.
If these troubleshooting measures don't resolve the issue, I suggest reaching out to the folks at MongoDB in a ticket, as suggested in this post from their forum: Cannot connect to Atlas from Kubernetes pod - MongoDB Atlas.