-
Notifications
You must be signed in to change notification settings - Fork 880
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
one cluster should have only one transport to reduce the number of TCP connections #5615
base: master
Are you sure you want to change the base?
Conversation
Welcome @lcw2! It looks like this is your first PR to karmada-io/karmada 🎉 |
9289780
to
ee350be
Compare
5b909be
to
423abb3
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5615 +/- ##
==========================================
+ Coverage 35.20% 38.28% +3.07%
==========================================
Files 645 649 +4
Lines 44869 45160 +291
==========================================
+ Hits 15795 17288 +1493
+ Misses 27844 26559 -1285
- Partials 1230 1313 +83
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
pkg/util/proxy/proxy.go
Outdated
clusterEndpoint := clusterEndpointInfo{ | ||
Transport: proxyTransport, | ||
} | ||
clusterEndpointInfoStore.Store(cluster.UID, clusterEndpointInfo{ |
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.
Just a question: When will the clusterEndpointInfo
be removed from the clusterEndpointInfoStore
?
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.
+1
@@ -174,7 +175,6 @@ require ( | |||
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect | |||
golang.org/x/mod v0.17.0 // indirect | |||
golang.org/x/oauth2 v0.18.0 // indirect | |||
golang.org/x/sync v0.7.0 // indirect |
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.
it seems that the go.mod file has not changed substantially. you need to restore it.
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.
difference in indirect
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.
I don't think it's necessary.
two questions:
|
I just feel like this approach seems too complicated and easy to go wrong. can we consider using all key fields(such as |
60a61a6
to
63a7ba2
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…P connections Signed-off-by: mengying <[email protected]>
/cc @whitewindmills @chaunceyjiang @yanfeng1992 |
for _, key := range proxyHeaderKeys { | ||
usedFields = append(usedFields, key, cluster.Spec.ProxyHeader[key]) | ||
} | ||
usedFields = append(usedFields, string(cluster.UID), cluster.Spec.ProxyURL, cluster.Spec.APIEndpoint) |
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.
is UID used by createProxyTransport
?
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.
UID changed means the cluster rejoined, should create a new transport.
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.
have you tested it yet? I thought of a scenario: when the cluster goes offline, the connection will be automatically disconnected after a period of time. when the cluster comes back online, can it work fine?
if value, ok := clusterEndpointInfoStore.Load(clusterHash); ok { | ||
return value, nil | ||
} | ||
proxyTransport, err := createProxyTransport(cluster, tlsConfig) |
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.
What happens if tlsConfig changes?
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.
It will not work fine, cannot request successfully. But I think no need to consider the scenario abourt secrets changes.
I stop the apiserver two minutes ,and restart the apiserver, karmadactl get nodes work fine. |
I'm not sure if you built the cache before stoping apiserver. maybe we haven't considered it comprehensively enough. can we talk about it in the next community meeting? |
OK |
What type of PR is this?
What this PR does / why we need it:
It can solve the problem about too many tcp connection between aggregated apiserver and apiserver of member's cluster
Which issue(s) this PR fixes:
Fixes #5574
Special notes for your reviewer:
test.sh
result.sh
fix before
fix after