0

I'm unable to run a health check other than process on a docker image deployed to Pivotal Cloud Foundry.

I can deploy fine with health-check-type=process, but that isn't terribly useful. Once the container is up and running I can access the health check http endpoint at /nuxeo/runningstatus, but PCF doesn't seem to be able to check that endpoint, presumably because I'm deploying a pre-built docker container rather that an app via source or jar.

I've modified the timeout to be something way longer than it needs to be, so that isn't the problem. Is there some other way of monitoring dockers deployed to PCF?

1 Answers1

0

The problem was the docker container exposed two ports, one on which the healthcheck endpoint was accessible and another that could be used for debugging. PCF always chose to try to run the health check against the debug port.

There is no way to specify, for PCF, a port for the health check to run against. It chooses among the exposed ports and for a reason I don't know always chose the the one intended for debugging.

I tried reordering the ports in the Dockerfile, but that had no effect. Ultimately I just removed the debug port from being exposed in the Docker file and things worked as expected.

  • Cloud Foundry always chooses the lowest-numbered `EXPOSE` port in your docker image to map from diego cell to container. – Josh Ghiloni Nov 17 '17 at 03:20
  • That wasn't what was happening. Ports 8787 and 8080 where both exposed. Only when I removed the 8787 port did PCF map to port 8080. – Brent DeMark Nov 27 '17 at 20:31