Endpoint for the hub-managed service in the spawned Jupyter notebook instance

Hi,

I am trying to figure out how can I get the data provided by the hub-managed service into the notebook instance that is spawned by the hub. The idea I want to implement is a service, which gets certain data, formats it, and exposes an endpoint within the hub, so the spawned notebooks can request the data from this endpoint.

As I understand, notebook can query hub directly, without going through proxy, so it is technically possible, but I can’t find the exact URL to the service, the closes thing I found was the API endpoint of the hub, which returns information about the service (/api/services/{service_name}).

JupyterHub and notebooks are running in kubernetes, using kubespawner, maybe it somehow affects network connection between notebooks and the hub.

In case of any questions please let me know, thank you in advance!