-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi-plexing single browser websocket to multiple backend websockets #1802
Comments
So far, my findings on the issue have been this.
I think we can efficiently manage multiple websocket connections to Kubernetes clusters, ensuring seamless communication between the frontend and the clusters while minimizing resource usage and overhead. WDTY cc @illume? |
For 2, there is going to be one web socket connection right? In this case it does not make sense to me that there is a cluster name used as a key. |
|
Other than those two points I’m not sure of it looks good to me. |
Yes only 1 connection would be there. We will use combination of something unique like
yes, good catch. Will think of something regarding this too. |
This adds websocket multiplexer to the backend. Frontend now make a single websocket call to the backend. Once that connection is established with the backend it will send message to the backend with appropriate data. Backend will open multiple websockets and act as a proxy to the frontend. It will make request to k8s server and return data to frontend. This also adds retry logic if the connection is broken between frontend and backend. Fixes: #1802 Signed-off-by: Kautilya Tripathi <[email protected]>
This adds websocket multiplexer to the backend. Frontend now make a single websocket call to the backend. Once that connection is established with the backend it will send message to the backend with appropriate data. Backend will open multiple websockets and act as a proxy to the frontend. It will make request to k8s server and return data to frontend. This also adds retry logic if the connection is broken between frontend and backend. Fixes: #1802 Signed-off-by: Kautilya Tripathi <[email protected]>
This adds websocket multiplexer to the backend. Frontend now make a single websocket call to the backend. Once that connection is established with the backend it will send message to the backend with appropriate data. Backend will open multiple websockets and act as a proxy to the frontend. It will make request to k8s server and return data to frontend. This also adds retry logic if the connection is broken between frontend and backend. Fixes: headlamp-k8s#1802 Signed-off-by: Kautilya Tripathi <[email protected]>
This adds websocket multiplexer to the backend. Frontend now make a single websocket call to the backend. Once that connection is established with the backend it will send message to the backend with appropriate data. Backend will open multiple websockets and act as a proxy to the frontend. It will make request to k8s server and return data to frontend. This also adds retry logic if the connection is broken between frontend and backend. Fixes: #1802 Signed-off-by: Kautilya Tripathi <[email protected]>
We started to draft a test plan for using the multiplexer for single clusters in this release, and for using the multiplexer in the next release for multiple cluster use.
Testing plan to decide when we release1) Detailed manual test of Headlamp
We think the normal pre-release manual testing, and the approximately 3 weeks of having the multiplexer enabled in main branch for developers to use day to day will be enough of a detailed test. So far two developers reported and fixed bugs related to the multiplexer. But no new bugs reported in the last week. 2) Investigate websocket errors/warnings in frontend/ tests@knrt10 is looking into this. #2753 3) Fix annoying log bug.
4) e2e tests for multi clustersThere are already tests which cover the real time use of headlamp with websockets. But not for multiple clusters.
|
In #1373 we investigated websocket pool max limit that browsers have. Which we quickly encounter.
One solution to this problem is to have a backend service which takes one websocket from the browser and makes multiple websocket connections via the backend to kubernetes API server.
We already use the backend server to proxy K8s API requests.
Architecture diagram:
Some related websocket links to multi plexing and proxying
The text was updated successfully, but these errors were encountered: