-
Notifications
You must be signed in to change notification settings - Fork 190
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
frontend: Add websocket multiplexer #2563
Conversation
Backend Code coverage changed from 61.1% to 61.2%. Change: .1% 😃. Coverage report
|
a3b5f1f
to
e23dd95
Compare
Backend Code coverage changed from 61.1% to 61.1%. Change: 0% 😃. Coverage report
|
e23dd95
to
af50857
Compare
Backend Code coverage changed from 61.0% to 61.2%. Change: .2% 😃. Coverage report
|
Hi, I've tried the test case that you've described and it doesn't work for me. It enters some kind of loop and keeps rerendering pod-creation-loop.mp4Another thing I've tried is setting allowed namespaces (default and store) in setting Then went to pods page and it connects to the first namespace twice, but should connect to both default and store |
So websocket connection can be of 4 types
|
af50857
to
8484f79
Compare
Backend Code coverage changed from 61.1% to 61.2%. Change: .1% 😃. Coverage report
|
8484f79
to
146c4db
Compare
Backend Code coverage changed from 61.0% to 61.1%. Change: .1% 😃. Coverage report
|
146c4db
to
6055579
Compare
Backend Code coverage changed from 61.0% to 61.2%. Change: .2% 😃. Coverage report
|
6055579
to
091b60a
Compare
Backend Code coverage changed from 61.0% to 61.1%. Change: .1% 😃. Coverage report
|
I've tried the "k run nginx" case again and it worked but I noticed that it recreates the connection on every update First it receives new pod {
"clusterId": "olek-test-cluster",
"path": "/api/v1/namespaces/default/pods",
"query": "watch=1&resourceVersion=34249370",
"userId": "4bd01bb98296b9e2",
"data": "{\"type\":\"ADDED...",
"type": "DATA"
} then frontend sends a close signal {
"clusterId": "olek-test-cluster",
"path": "/api/v1/namespaces/default/pods",
"query": "watch=1&resourceVersion=34249370",
"userId": "4bd01bb98296b9e2",
"type": "CLOSE"
} and then right after that it requests a new connection with a new resource version {
"clusterId": "olek-test-cluster",
"path": "/api/v1/namespaces/default/pods",
"query": "watch=1&resourceVersion=34249403",
"userId": "4bd01bb98296b9e2",
"type": "REQUEST"
} |
Note: Olek did some more tests for useWatchKubeObjecfLists which have been merged into main now. |
091b60a
to
ceca8d2
Compare
Backend Code coverage changed from 61.0% to 61.1%. Change: .1% 😃. Coverage report
|
ceca8d2
to
b96d1ad
Compare
Sure, make sense |
a48b943
to
839bd41
Compare
839bd41
to
fff39d1
Compare
Addressed changes, please review |
Backend Code coverage changed from 61.1% to 63.6%. Change: 2.5% 😃. Coverage report
|
Backend Code coverage changed from 61.1% to 63.5%. Change: 2.4% 😃. Coverage report
|
Thanks for the changes. Looking forward to merging this soon! 🎉 I updated the convos still open, and left notes about the ones with stuff still to go. A summary of what's remaining:
It would be nice if we could get a review from Santhosh on the backend parts at least for security/correctness. But this could also come post merge (but before it's released). It's important to merge it in earlier in this release cycle so it can get more day to day use. |
This adds a single websocket connection from frontend to backend and sends lists of messages to the backend. With the help of messages backend creates multiple websocket connection to k8s API and returns back the data. This solves the issue for limiting of websocket connection in frontend in case of multi cluster setup. Signed-off-by: Kautilya Tripathi <[email protected]>
fff39d1
to
b044c01
Compare
Backend Code coverage changed from 60.8% to 63.3%. Change: 2.5% 😃. Coverage report
|
Now websocket has clear type that is needs to sends. This also fixes panic of websocket in various edge cases. Signed-off-by: Kautilya Tripathi <[email protected]>
b044c01
to
5978d86
Compare
Backend Code coverage changed from 60.9% to 63.6%. Change: 2.7% 😃. Coverage report
|
This adds a new way to use new way to run websocket multiplexer. Default way would be the legacy way which creates multiple websocket connection. This adds a new flag `REACT_APP_ENABLE_WEBSOCKET_MULTIPLEXER` to run the new API. Signed-off-by: Kautilya Tripathi <[email protected]>
Signed-off-by: Kautilya Tripathi <[email protected]>
5978d86
to
28003c3
Compare
Backend Code coverage changed from 60.8% to 63.6%. Change: 2.8% 😃. Coverage report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Great work. Thanks!
I got following error. |
Thanks @farodin91 |
Thanks @farodin91 opened a fix for it in #2731 |
This adds a single websocket connection from frontend to backend and sends lists of messages to the backend. With the help of messages backend creates multiple websocket connection to k8s API and returns back the data.
This solves the issue for limiting of websocket connection in frontend in case of multi cluster setup.
Fixes: #2515
Testing
cd frontend && npm run start #(default is multiplexer enabled)
cd backend && go run ./cmd -dev -enable-dynamic-clusters
kubectl run nginx --image=nginx
TODO
cd backend && go test -race -v -p 1 ./...