<p>I'm trying to deploy my app in Google Cloud Kubernetes Engine; it consists of backend (in Node.JS) and a DB (MongoDB). </p>

<p>When I'm testing it on my local VM within Minikube it works as expected - I can connect from the API to the DB.</p>

<p>However, when deploy it on GCP my API can't connect, and after checking the API's pod logs, I see the <code>MongoDB :: connection error: MongoTimeoutError: Server selection timed out after 30000 ms</code> error. </p>

<p>I don't know if it matters, but those two microservices are in the same node. </p>

<p>Is there any difference to be aware of between the local Minikube setup and the GCP setup?</p>

Murakami
<p>After all this helped me:
<a href="https://stackoverflow.com/questions/28776013/google-cloud-platform-cant-connect-to-mongodb">Google Cloud Platform - Can&#39;t connect to mongodb</a></p>

<p>First answer shows how to add firewall rule but second is even more important to change IP address inside the mongodb config. May it be done easier?</p>
