I'm currenly learning about Kubernetes (and other DevOps related technologies) and decided to create a simple project - deploying and testing a MongoDB database using K8s.
I've uploaded all the code to my personal GitHub: https://github.com/MCAntunes/DevOpsTraining
I've tested everything in my local machine (Windows 10) to make sure everything worked before moving to GitHub actions, and it indeed works.
When I try to connect to the database and run a simple command using
mongo mongodb://ip:port --eval "db.adminCommand('listDatabases')"
I get the following error:
MongoDB shell version v4.4.6
connecting to: mongodb://172.17.0.3:30000/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server 172.17.0.3:30000, connection attempt failed: SocketException: Error connecting to 172.17.0.3:30000 :: caused by :: Connection refused :
I already disabled authorization to make sure that it wasn't a problem.
I also added following command to allow connections from all IPs but it didn't solve the problem.
--bind_ip ::,0.0.0.0
I don't know what could be the problem, but I suspect something network related.
Is there something I could do to try to diagnose the problem?
Thanks in advance. If you need more information please don't hesitate to ask.