How to connect to mongodb atlas cluster from a kubernetes

August 11, 2019 142 views
Kubernetes MongoDB

Hi Folks,

We have nodeJS application, which we are trying to deploy on DO K8S. we use mongodb atlas and mongoose, it works perfectly on DO on docker-compose. I am getting below error when deploying on K8S. Appreciate any help; I have already explored a lot but no help


1 Answer

Hi there!

It looks like you may have resolved this issue in your stack overflow:

I figured out the issue, my pod DNS was not configured to allow external connections, so I set dnsPolicy: Default in my YML

Let me know if you have any additional questions.


John Kwiatkoski
Senior Developer Support Engineer

Have another answer? Share your knowledge.