Container health check for ECS task with awsvpc network mode

0

Hi,

I'd like to create an ECS task with network mode "awsvpc". The container in the task should have a health check command calling a REST endpoint in the container via curl.

With bridge network mode I'd add the health check command as "CMD,curl,--fail,http://localhost:8080/health/check/endpoint".

However with awsvpc mode, it seems that the container is not reachable via localhost.

How does a healthcheck work if the network mode is "awsvpc"?

Cheers,
Markus

mksplg
asked 4 years ago3141 views
2 Answers
0

Hi,

According to the documentation here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_healthcheck
You should be using CMD-SHELL instead of CMD

Olek
answered 4 years ago
0

Looks like I had to use localhost to connect to the instance.

mksplg
answered 3 years 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