Dynamic port mapping - health check failures for target group in ECS cluster

0

We have our application hosted in ECS cluster as container. Also we have nginx running in a container to reverse proxy. 0.0.0.0:80->8080/tcp - application 0.0.0.0:81->80/tcp - nginx

I have a target group having my instances running on port 80 and health check settings configured to use override option and port mentioned as 81 - so that health passes

I am trying to use ECS blue green code deploy option in code pipeline to automate deployments. To achieve this, I have changed my application port mapping to dynamic so that it runs in a random port - for ex: 0.0.0.0:32768:8080

I created a task definition to use dynamic port mapping like 0:8080

I have an application load balancer which listens on 80 and 443 and redirect traffic to target group .

While trying to create a service using the above ALB andd TG, I am getting error as the task definition uses dynamic port mapping but the target group uses particular port specified in health check settings.

So I have changed the health check setting option to use traffic port option - but doing so the health check always fails.

Could you please help me in configuring a health check for dynamic port mapping or how to configure the resources for blue green deployments to my container.

Note : My application does not need any task to be running and its just deploying once. Verified security group inbound rules to allow traffic from load balancer

  • Did you resolve this already?

1 Answer
0

Have you checked the security groups on the containers allows access on the ports by the health check?

profile picture
EXPERT
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions