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
질문됨 4년 전3141회 조회
2개 답변
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
답변함 4년 전
0

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

mksplg
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠