2

This is the targets in my target group. They corresponds to the docker processes running in my ecs service.

enter image description here

As you can see all processes are marked as either draining or unhealthy.

Here is how I define my Health checks,

enter image description here

I have tried the health check url on a local docker process and the url works as expected.

enter image description here

The same log messages are not found incloud watch log. I presume the healthcheck url is not called at all.

Here is my container definition in my task

enter image description here

As you can see in the above screenshot, I have mapped port 0 to 8090. I believe it is how to enable dynamic mapping.

Also I have set the network mode to 'Bridge'

How can get the health check to work? I think currently it is the reason why I cannot reach the underlying docker processes.

Anthony Kong
  • 2,976
  • 10
  • 53
  • 91

2 Answers2

2

It seems to be an issue with the default security group when I created the ecs cluster

The default SG is

enter image description here

So basically no traffic can reach the ec2 instance that hosts the docker process.

I added a very permissive security group and it is working and I can reach the healthcheck url

Anthony Kong
  • 2,976
  • 10
  • 53
  • 91
1

In my case there was problem with health check. I added Success codes 200 but my services are secured and it returns 401 on health check.

I added 200,401,404 as health check success codes.

DV Singh
  • 111
  • 2