koord-descheduler: add migration object limiter for namespace
Ⅰ. 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
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.
/hold
/unhold
/lgtm
[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
- ~~pkg/descheduler/OWNERS~~ [hormes]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment