I have deployed JupyterHub (following the Guide from Z2JH) in an on premise Kubernetes Cluster. It’s running Ubuntu 18.04.3 LTS and K8s version is 1.16.3. I’m using OpenEBS for PV and PVC. I create an Ingress for the Service, which I changed form LoadBalancer to ClusterIP.
When I try to run some Python code, it doesn’t do anything. I try to reconnect and restart the kernel, and it’s not working.
Where can I find more information about what’s happening? I check the logs from the pod itself and the hub’s pod and I cannot see anything.
Are there any errors in your browser’s javascript console? If you’re not familiar with the console see Major Browsers' Debugging Tools on https://www.w3schools.com/js/js_debugging.asp for instructions on how to open it.
As far as I can see, I discovered that the connection to the kernel is done through a WebSocket, which is different than http or https (returning HTTP 504). I’m using IngressController to expose proxy-public (http and https), but maybe I need to expose another think, or it will only work if using LoadBalancer Service.
Is it possible to configure the connection port with the kernel? Which additional things do I need to configure in Kubernetes?
My config.yaml is the same as following the guide of Z2JH. I have the secret and I configured the datascience-notebook as main image (tagging the most recent one) and opening lab page (not tree).
My Kubernetes is v1.16.3. Is on premise and I cannot use LoadBalancer, so I changed the type of the service proxy-public to ClusterIP, to expose it via Ingress.
I created an Ingress (my controller is nginx (from nginxinc/kubernetes-ingress) to connect to the service proxy-public to port 80.
In case it’s necessary, I can generate a SSL Certificate with Let’s Encrypt, but I don’t think it will work.
The only error in browser is that it cannot connect to kernel. I can log in, start a server (I also can shut it down), but when I want to execute code, it shows me a dialog that cannot connect to the kernel. And the request that connects to the kernel (which uses wss) returns HTTP 504. It tries to reconnect, but the same.
Logs from Firefox:
GET https://<host>/user/<username>/api/kernels/1d3340a0-8f4d-4d6a-8a9b-1c84293bd9e1/channels?session_id=b029b6b3-9d46-47ec-9c58-e9a2d697a4bf&token=45f2f1d6577b4ad19bfcad564f1faaf2 HTTP 504 Gateway Time-out
Starting WebSocket: wss://<host>/user/<username>/api/kernels/1d3340a0-8f4d-4d6a-8a9b-1c84293bd9e1
Firefox can't establish a connection to the server at wss://<host>/user/<username>/api/kernels/1d3340a0-8f4d-4d6a-8a9b-1c84293bd9e1/channels?session_id=ccc9f084-bce5-4f72-b998-451a9bfeca15&token=45f2f1d6577b4ad19bfcad564f1faaf2. || default.js:57:58
Connection lost, reconnecting in 2 seconds || default.js:140:17
Is there some configuration to increase the verbosity?
Jupyters Proxy reconfigured as ClusterIP, used ingress from values.yaml with value=true without additional websocket annotations.
EDITED: just discovered, that connecting to proxy-public service (configured as ClusterIP) - no broken connection to kernel appears, everything works smooth. With ingress = true, kernel connection breaking.