If I change a task from: 

  "networks": [ 
    { "mode": "host" }
  ],
  "portDefinitions": [
    {"port": 0, "name": "health",  "protocol": "tcp"},
        {"port": 0, "name": "metrics",  "protocol": "tcp"}
  ],

To: 

  "networks": [ 
    { "mode": "container", "name": "cni-storage" }
  ],
  "portDefinitions": [
    {"port": 0, "name": "health",  "protocol": "tcp"},
        {"port": 0, "name": "metrics",  "protocol": "tcp"}
  ],


I am getting this error:

W0804 23:18:12.942282 3421440 health_checker.cpp:273] HTTP health check 
for task 'dev_.instance-78cc92f7-d697-11ea-b815-e41d2d0c3e20._app.1' 
failed: curl exited with status 7: curl: (7) Failed connect to 
127.0.0.1:0; Connection refused
I0804 23:18:12.942337 3421440 health_checker.cpp:299] Ignoring failure 
of HTTP health check for task 
'dev_.instance-78cc92f7-d697-11ea-b815-e41d2d0c3e20._app.1': still in 
grace period

But when I disable the health check, and enter the network namespace of 
the running task. This localhost check is working
[@ c59ea592-322f-4bfc-8981-21215904da58]# curl 
http://localhost:52684/test
<html><body><h1>200 OK</h1>
Service ready.
</body></html>

What am I doing wrong?








Reply via email to