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
feita há 4 anos3142 visualizações
2 Respostas
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
respondido há 4 anos
0

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

mksplg
respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas