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

Add option to ignore pods with PVCs from eviction #481

Merged
merged 1 commit into from Jan 27, 2021

Conversation

damemi
Copy link
Contributor

@damemi damemi commented Jan 11, 2021

Fixes #96

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 11, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 11, 2021
@damemi
Copy link
Contributor Author

damemi commented Jan 11, 2021

/hold
make gen is currently broken due to the logging fields

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 11, 2021
Copy link
Contributor Author

@damemi damemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold cancel
make gen is fixed now

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 11, 2021
@damemi damemi force-pushed the ignore-pvc-pods branch 3 times, most recently from a8cc407 to 615ce3a Compare January 11, 2021 20:44
@damemi
Copy link
Contributor Author

damemi commented Jan 12, 2021

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 12, 2021
Copy link
Contributor

@ingvagabund ingvagabund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case for the new flag? In any of the strategies you choose.

Wrt. ignore prefix, we already have ExcludeOwnerKinds and Exclude namespaces fields. Do you think it would make sense to align the new field with existing ones? I.e. excludePVCPods? Even IgnorePVCPods sounds ok to me. Just a thought.

cmd/descheduler/app/options/options.go Outdated Show resolved Hide resolved
Copy link
Contributor

@lixiang233 lixiang233 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should update README to include the new flag

@damemi
Copy link
Contributor Author

damemi commented Jan 25, 2021

Updated this to remove the extra line and added the flag to readme

@ingvagabund
Copy link
Contributor

ingvagabund commented Jan 26, 2021

Unit test please (to validate user facing change)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 26, 2021
@damemi
Copy link
Contributor Author

damemi commented Jan 26, 2021

Sorry, forgot the unit test. Added to PodLifeTime

Copy link
Contributor

@lixiang233 lixiang233 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 27, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi, lixiang233

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

@k8s-ci-robot k8s-ci-robot merged commit 241f132 into kubernetes-sigs:master Jan 27, 2021
@jsravn
Copy link
Contributor

jsravn commented May 6, 2021

Minor nit: could we rename the option from ignorePvcPods to evictPvcPods before this is released? I found the option name confusing - I took it to mean "ignore PVCs when considering a pod for eviction", rather than "ignore pods with PVCs when evicting".

@damemi
Copy link
Contributor Author

damemi commented May 6, 2021

Hi @jsravn, thanks for the feedback. The motivation behind naming this ignorePvcPods was the the current default Descheduler behavior is to evict Pvc Pods. So, rather than add the new flag with a default value true, we added it so that it semantically defaults to false, preserving the existing default behavior without any change to behavior.

I hope this clears up the confusion. At this point, I would personally prefer not to make that change since it would be a full invert of the behavior. However if others disagree I am open to the consideration

briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
Add option to ignore pods with PVCs from eviction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filter pods with pvc volumes
5 participants