Jupyterhub sometimes can't access localhost:8081/api/hub

For openshift - we are using the exact same configuration in a few OpenShift environments and a few AWS environments (EKS). The error does not affect the usability of Jupyterhub. This error is thrown when we try to fetch the image from the OpenShift image registry using the package openshift. If this fails (ergo we are on AWS), there is error handling that takes care.

We have resolved the intermittent failure issue. It was due to the Jupyterhub k8s service having selector app:jupyterhub, and Jupyterhub server and notebooks both having the same label. This meant that the service directed requests both to the server and the notebooks at random.

So, we added component: jupyterhub to all relevant places in the deployment and in the service, which forced the service to route requests only to the Server. This solved the intermittent request failure issue.

The CORS thing remains unresolved. We played around with the configurations of the NGINX controller, the k8s Ingress, but without success.