Closed captmicr0 closed 4 months ago
I'm not sure if we'll gonna add a dedicated healthcheck that's tied to the tunnel's status as it's not really that important since you can always refer to the health status of the tunnel directly from your zerotrust dashboard.
Also the healthcheck should supposedly refer to the container's status rather than the tunnel's. If we tie the healthcheck to the tunnel connection, docker will think that the container is unhealthy if you stopped the tunnel even though the container is running perfectly fine. So it will create a confusion right there.
For your use-case, you might want to use Cloudflare API and use that for adding a custom healthcheck for the container:
https://developers.cloudflare.com/api/operations/cloudflare-tunnel-get-a-cloudflare-tunnel
The response object contains a status
property that tells you if the connection is healthy or not. This is more accurate and reliable than checking if the start value in the config is true/false.
Closing this issue.
Currently adding healthchecks to all my docker containers, and this container specifically was quite hard to implement one for.
I wanted the healthcheck to be based on the status of the tunnel connection, giving a healthy status when the tunnel is connected.
Right now I'm using this in my docker-compose file:
Any plans to implement a healthcheck in the Dockerfile itself?