-
Notifications
You must be signed in to change notification settings - Fork 124
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
add sharding feature for ClusterSynchroManager #609
Conversation
Hi @jxustc, DetailsInstructions for interacting with me using comments are available here. |
Rearranged the logic(pseudocode):
It might be useful. |
Thanks for the suggestion, I will improve it over the weekend |
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.
Others look good, only a little bit of modification needed
|
||
if cluster.Status.ShardingName != nil && *cluster.Status.ShardingName != manager.shardingName { | ||
return controller.NoRequeueResult | ||
} |
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 think this could be put into a separate function, which would add more comprehensive unit testing to it.
But it can be optimized in a new pr.
Signed-off-by: jixiang <2623210647@qq.com> make codegen Signed-off-by: jixiang <2623210647@qq.com> make crds Signed-off-by: jixiang <2623210647@qq.com> add zz_generated.deepcopy.go Signed-off-by: jixiang <2623210647@qq.com> resolve some conversations and rearrange the code Signed-off-by: jixiang <2623210647@qq.com> format code Signed-off-by: jixiang <2623210647@qq.com> resolve some conversations Signed-off-by: jixiang <2623210647@qq.com> resolve some conversations Signed-off-by: jixiang <2623210647@qq.com>
@@ -160,13 +162,18 @@ func (o *Options) Config() (*config.Config, error) { | |||
} | |||
kubeStateMetricsServerConfig := o.KubeStateMetrics.ServerConfig(metricsConfig) | |||
|
|||
if o.ShardingName != "" { | |||
o.LeaderElection.ResourceName = fmt.Sprintf("%s-%s", o.LeaderElection.ResourceName, o.ShardingName) |
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.
Do we need to check whether the resource already exists here?
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.
The leaderelection will take care of checking for the resource, and if it already exists then it will race for 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.
LGTM, Thanks
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implement the basic sharding feature of the ClusterSynchroManager
Which issue(s) this PR fixes:
Fixes #599
Special notes for your reviewer:
This is a PR for the V1.0 version of the ClusterSynchroManager sharding feature, based on the latest design version discussed previously
Does this PR introduce a user-facing change?: