How to Connect MongoDB with AWS EKS and Load Balancer?

0
6
Asked By CuriousCoder92 On

I'm working on an AWS project that involves setting up AWS EKS with my MongoDB running on an EC2 instance. I'm building a simple TODO app in Golang, and I've successfully pushed my Docker image to AWS ECR. However, I'm struggling to connect everything together. I initially tried deploying an AWS NLB via Terraform, but I wasn't able to get any healthy targets in my target group using the EKS node instance IPs. Although I was able to deploy a new Nginx load balancer using a manifest and kubectl, my app was exposed, but I still couldn't connect to the MongoDB database. Everything is within one VPC. Can anyone provide some guidance?

1 Answer

Answered By TechieTommy88 On

You need to install the AWS Load Balancer Controller first. It’s essential for properly setting up your LoadBalancer service in EKS. After that's done, create a service of type 'LoadBalancer' and EKS will take care of provisioning the NLB for you. Don’t forget to check the annotations in the documentation to customize your setup!

DevNinja47 -

I had similar issues but ended up getting it to work with the commands you mentioned, and my targets started showing healthy. My main problem was connecting to the database afterward.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.