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
posta 4 anni fa3142 visualizzazioni
2 Risposte
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
con risposta 4 anni fa
0

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

mksplg
con risposta 3 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande