koordinator icon indicating copy to clipboard operation
koordinator copied to clipboard

koord-descheduler: add migration object limiter for namespace

Open songtao98 opened this issue 1 year ago • 4 comments

Ⅰ. Describe what this PR does

This PR add a new type of migration object limiter for namespace. To implement this, the arbitrator of MigrationController traverses all objectLimiters and judge a pod through limiters enabled one by one. When a pod is judged by Workload limiter, first try to get its ownerReference, if there is no ownerReference of this pod, just skip it. When a pod is judged by Namespace limiter, judge it by number of migrated pods in this namespace. The similar logic is implemented in trackEvictedPod function, too.

Ⅱ. Does this pull request fix one issue?

fixes #2051

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • [ ] I have written necessary docs and comments
  • [ ] I have added necessary unit tests and integration tests
  • [ ] All checks passed in make test

songtao98 avatar May 27 '24 12:05 songtao98

Codecov Report

Attention: Patch coverage is 77.64706% with 19 lines in your changes missing coverage. Please review.

Project coverage is 67.94%. Comparing base (beac34f) to head (72f9108).

Files Patch % Lines
...kg/descheduler/controllers/migration/controller.go 79.51% 10 Missing and 7 partials :warning:
...heduler/controllers/migration/arbitrator/filter.go 0.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2068      +/-   ##
==========================================
+ Coverage   67.90%   67.94%   +0.03%     
==========================================
  Files         441      441              
  Lines       41551    41589      +38     
==========================================
+ Hits        28217    28258      +41     
+ Misses      10903    10898       -5     
- Partials     2431     2433       +2     
Flag Coverage Δ
unittests 67.94% <77.64%> (+0.03%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 28 '24 02:05 codecov[bot]

/hold

songtao98 avatar May 29 '24 06:05 songtao98

/unhold

songtao98 avatar Jun 28 '24 10:06 songtao98

/lgtm

ZiMengSheng avatar Jul 18 '24 13:07 ZiMengSheng

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hormes

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

koordinator-bot[bot] avatar Jul 22 '24 08:07 koordinator-bot[bot]