Access container end point in multi-container environment using Application Load Balancer DNS in aws

70 Views Asked by At

Hello all so I have a Springboot application that is fetching data from aws S3 and I am using Prometheus to monitor the Springboot app. In ECS I create a task definition and added both the images with their respective port mappings then I created a service and a Application Load Balancer in which I added Springboot app image to load balance and also created target group to forward traffic to 8080 on which my spring app is running all of this is working fine I am able to hit my spring app endpoint by using ALB DNS but is there nay way with which can access the Prometheus dashboard which is on port 9090

I tried adding listener 90 to ALB and created separate target group to redirect traffic to 9090 I didn't give any error but even tough how to access the Prometheus dashboard because the DNS is itself working as 8080

2

There are 2 best solutions below

1
Mark B On

"I tried adding listener 90 to ALB and created separate target group to redirect traffic to 9090"

That's exactly what you would need to do.

"I didn't give any error but even tough how to access the Prometheus dashboard because the DNS is itself working as 8080"

This last statement is really confusing. DNS doesn't work on a port. When you don't specify a port, it does the default HTTP port which is 80. You added another listener on port 90. So you need to add port 90 to your URL in the web browser to access that listener: http://load-balancer-dns-name:90

1
Vishal C On

OK so this might not be a direct answer but for anyone experiencing the same issue I later integrated Nginx as reverse proxy in my project and with that integrated is works fine now