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
demandé il y a 4 ans3141 vues
2 réponses
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
répondu il y a 4 ans
0

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

mksplg
répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions