I’ve deployed a streamlit app to a Kubernetes cluster. I’m using the default config (no
browser.serverAdress tweaks as mentioned in other threads here). I’m using a load balancer that wires requests from https://my-streamlit-app.my-domain.com/ (hence port 80) to the container on its port 8501. I use
https, so the websocket calls use the
Using port-forwarding, I can confirm the deployment is working. Therefore if I do
kubectl port-forward my-pod 5000:8501 and go to
http://localhost:5000 everything works as expected.
But if I go to
https://my-streamlit-app.my-domain.com/, I see the unfriendly
Please wait... and the app doesn’t load.
By looking into the chrome dev tools’ network tab, I see that the websocket call to
Request URL: wss://tagging-stg.onefootball.com/stream fails with :
- either the error message
WebSocket is closed before the connection is established.
- or the message
Error during WebSocket handshake: Unexpected response code: 400.
I sense this might be a reverse-proxy/server configuration issue. I’ll leave here the content of the headers for those requests (among other things, but I have no clue if the rest is relevant or not):
Connection: Upgrade Host: my-streamlit-app.my-domain.com Origin: https://my-streamlit-app.my-domain.com Upgrade: websocket
I’m at a loss here. Kubernetes is our deployment of choice at my company and I cannot figure out how to deploy streamlit there so it’s blocking our adoption.
- Has anyone seen those websocket errors before?
- Is this an issue with tornado or this an issue with the reverse-proxy config ?
- Why is the app working fine when port-forwarding and not when accessing the website directly ?
Thanks in advance