How to do Jupyterhub health check

I have Jupyterhub running in Kubernetes. One instance of jupyterhub a primary data center and another instance in a secondary data center. In order for a global traffic manager to automatically detect and failover to secondary DC when the instance in primary DC goes down, I’m required to supply a fixed named static page at root of the path “/healthstatus”. When this page is hit, response “pass” indicates its healthy and no response indicates its unhealthy.

My question: What’s the best place/way to fulfill this health check request?

I’m looking at a couple of candidates:

  1. Put the response “pass/fail” in CHP (default configurable http proxy that comes with jupyterhub) configureproxy.js by adding a handler to path /healthstatus. But that means health check is only done at the proxy level. It doesn’t hit jupyterhub. In addition, I’d have to modify the configureproxy.js source code.

  2. Configure CHP with a route to forward traffic from /healthstatus to /hub/health. When response is 200 code, transform the response to text “pass” and return to caller. This way it hits the jupyterhub health check endpoint. However, I’m not sure how to add such route in CHP. Is there a way to accomplish it without modifying the source code?

Any other suggestions?