newrelic / centurion

A mass deployment tool for Docker fleets
MIT License
1.76k stars 113 forks source link

host-networked services without defined port mappings don't get health checked #164

Closed intjonathan closed 7 years ago

intjonathan commented 8 years ago

Services which use network_mode: 'host' don't need to define any port mappings, since they use the host network stack directly. However, if they don't define any mappings, they also don't have the containers checked between servers during rolling deploys. The iteration over public_ports here would be a no-op in that case.

The workaround would be to define a dummy port, but if you do that, the stop_container call here doesn't work, because it tries to find existing containers by public port - which it doesn't have.

relistan commented 8 years ago

Err that's annoying. The simplest solution would be to add a health check ports list and if it hasn't been defined, then default to the original behavior.

intjonathan commented 8 years ago

There's an interaction here if you specify a method as the healthcheck, perhaps the method should do its own port selections?