Skip to content
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

koord-descheduler: support soft eviction takeover eviction behavior #1128

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

leason00
Copy link
Contributor

@leason00 leason00 commented Mar 20, 2023

Ⅰ. Describe what this PR does

By tagging, the user takes over the eviction.

Ⅱ. Does this pull request fix one issue?

fixes #1102

Ⅲ. Describe how to verify it

  1. Enable this feature in koord-descheduler-config
pluginConfig:
- name: MigrationController
  args:
    apiVersion: descheduler/v1alpha2
    kind: MigrationControllerArgs
    evictionPolicy: SoftEviction
    evictLocalStoragePods: true
    ignorePvcPods: true
    namespaces:
      include:
          - qa
    evictQPS: "10"
    evictBurst: 1
  1. A annotation will be written on Pod
apiVersion: v1
kind: Pod
metadata:
  annotations:
   scheduling.koordinator.sh/soft-eviction: |-
          {
            "timestamp": 1679970640,
            "deleteOptions": {},
            "initiator": "xxx",
            "reason": "xxx"
          }

Ⅳ. 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
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Patch coverage: 89.28% and project coverage change: -0.15 ⚠️

Comparison is base (76fe941) 66.72% compared to head (c036d67) 66.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1128      +/-   ##
==========================================
- Coverage   66.72%   66.57%   -0.15%     
==========================================
  Files         267      277      +10     
  Lines       29319    29999     +680     
==========================================
+ Hits        19562    19971     +409     
- Misses       8366     8601     +235     
- Partials     1391     1427      +36     
Flag Coverage Δ
unittests 66.57% <89.28%> (-0.15%) ⬇️

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

Impacted Files Coverage Δ
...uler/controllers/migration/evictor/evictor_soft.go 89.28% <89.28%> (ø)

... and 42 files with indirect coverage changes

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eahydra eahydra changed the title support custom evictor koord-descheduler: add new evictor to support users take over eviction behavior themselves Mar 21, 2023
@eahydra
Copy link
Member

eahydra commented Mar 21, 2023

Hi @leason00, thanks for your contribution.

Do we need to implement a new Evict Plugin? For issue #1102, my original idea was to add a new implementation to the evictor in PodMigrationController. Users can enable this new evictor implementation in MigrationControllerArgs.

In addition, we need to define the annotation added when the evict is executed, and define it as an API in apis/extension/descheduling.go , for example, scheduling.koordinator.sh/eviction=true means triggering eviction. In addition, you may have to consider adding some additional information, such as the time to trigger the eviction, the reason, who triggered it, and whether to set gracePeriodSeconds and forceDeletion, etc.

I think maybe a simple proposal can be given to clearly define this new change and API.

@hormes
Copy link
Member

hormes commented Mar 22, 2023

Do you want to reuse other logic in MigrationController?

@leason00
Copy link
Contributor Author

It is better to reuse MigrationController. I'm going to redesign the MigrationController-based approach.

@leason00
Copy link
Contributor Author

@eahydra Resubmitted. Review it again when you have time.

@eahydra eahydra added this to the v1.2 milestone Mar 30, 2023
@leason00 leason00 requested review from eahydra and removed request for hormes, FillZpp and jasonliu747 March 30, 2023 07:31
@hormes
Copy link
Member

hormes commented Mar 30, 2023

nice work!

@hormes
Copy link
Member

hormes commented Mar 30, 2023

/lgtm

apis/extension/descheduling.go Outdated Show resolved Hide resolved
apis/extension/descheduling.go Outdated Show resolved Hide resolved
@eahydra eahydra changed the title koord-descheduler: add new evictor to support users take over eviction behavior themselves koord-descheduler: support soft eviction Mar 30, 2023
@eahydra eahydra changed the title koord-descheduler: support soft eviction koord-descheduler: support soft eviction takeover eviction behavior Mar 30, 2023
@koordinator-bot koordinator-bot bot removed the lgtm label Mar 31, 2023
Signed-off-by: lisen <lisen@youzan.com>
@FillZpp
Copy link
Member

FillZpp commented Mar 31, 2023

/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FillZpp

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

@eahydra
Copy link
Member

eahydra commented Mar 31, 2023

/lgtm

@koordinator-bot koordinator-bot bot added the lgtm label Mar 31, 2023
@koordinator-bot koordinator-bot bot merged commit a8849cd into koordinator-sh:main Mar 31, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[proposal] descheduler should support users take over eviction behavior themselves
4 participants