karmada icon indicating copy to clipboard operation
karmada copied to clipboard

Add placement for bindingSpec

Open Poor12 opened this issue 3 years ago • 7 comments

Signed-off-by: Poor12 [email protected]

What type of PR is this? /kind api-change

What this PR does / why we need it: Now taintManager gets placement from annotations of Binding, mainly for clusterToleration field to check whether the binding should be evicted from targe cluster right now. Scheduler gets placement from annotations of Binding, to check whether the placement has changed.

Add placement for BindingSpec can reduce the dependency of policy and make API more clear. Now the component above will check the placement of bindingSpec first and switch to get placement from annotations if placement of bindSpec is empty.

It can be smoothly upgraded from a lower version to a higher version. If karmada-controller-manager upgrades, spec.placement will occur according to the placement of policy .

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?: None

Poor12 avatar Oct 29 '22 09:10 Poor12

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign kevin-wangzefeng after the PR has been reviewed. You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar Oct 29 '22 09:10 karmada-bot

Now we get placement from annotations of Binding, add toleration for bindingSpec so that taintManager do not need to query pp.

Please explain it in more detail. Who is we? Please show the code where this change would benefit.

RainbowMango avatar Oct 29 '22 09:10 RainbowMango

Codecov Report

Merging #2702 (5eff625) into master (69ecff6) will increase coverage by 0.36%. The diff coverage is 0.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #2702      +/-   ##
==========================================
+ Coverage   47.98%   48.35%   +0.36%     
==========================================
  Files         200      201       +1     
  Lines       18082    18070      -12     
==========================================
+ Hits         8677     8738      +61     
+ Misses       8924     8847      -77     
- Partials      481      485       +4     
Flag Coverage Δ
unittests 48.35% <0.00%> (+0.36%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/detector/detector.go 0.00% <0.00%> (ø)
pkg/scheduler/core/generic_scheduler.go 0.00% <0.00%> (ø)
pkg/scheduler/event_handler.go 28.17% <0.00%> (+4.16%) :arrow_up:
pkg/scheduler/scheduler.go 18.51% <0.00%> (+0.41%) :arrow_up:
...einterpreter/defaultinterpreter/aggregatestatus.go 71.02% <0.00%> (-0.52%) :arrow_down:
pkg/karmadactl/util/idempotency.go 23.07% <0.00%> (ø)
pkg/karmadactl/cmdinit/karmada/deploy.go 0.00% <0.00%> (ø)
pkg/karmadactl/cmdinit/cmdinit.go 72.36% <0.00%> (ø)
pkg/search/proxy/store/util.go 93.36% <0.00%> (+0.47%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Oct 29 '22 09:10 codecov-commenter

https://github.com/karmada-io/karmada/blob/1d2028b10f9b9d9ca30fe8e963b4557d347c8f51/pkg/controllers/cluster/taint_manager.go#L219-L248

Are you trying to optimize this piece of code?

chaunceyjiang avatar Oct 31 '22 07:10 chaunceyjiang

https://github.com/karmada-io/karmada/blob/1d2028b10f9b9d9ca30fe8e963b4557d347c8f51/pkg/controllers/cluster/taint_manager.go#L219-L248

Are you trying to optimize this piece of code?

Not quite. Mainly to make calls simpler and make the API clearer.

Poor12 avatar Oct 31 '22 11:10 Poor12

/cc @RainbowMango

Poor12 avatar Nov 04 '22 08:11 Poor12

Please add an agenda to next week's community meeting for public comment.

RainbowMango avatar Nov 04 '22 09:11 RainbowMango

Let me take a review. /assign

XiShanYongYe-Chang avatar Feb 06 '23 03:02 XiShanYongYe-Chang

Please fix the CI.

RainbowMango avatar Feb 09 '23 03:02 RainbowMango

/assign

RainbowMango avatar Feb 09 '23 11:02 RainbowMango

This PR could help #2968 for determining whether a binding is divided scheduling easily.

Garrybest avatar Feb 10 '23 03:02 Garrybest

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar Feb 13 '23 03:02 karmada-bot