-
Notifications
You must be signed in to change notification settings - Fork 669
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 new DefaultEvictor plugin with args #929
Add new DefaultEvictor plugin with args #929
Conversation
/hold |
pkg/framework/plugins/defaultevictorfilter/defaultevictorfilter.go
Outdated
Show resolved
Hide resolved
pkg/framework/plugins/defaultevictorfilter/defaultevictorfilter.go
Outdated
Show resolved
Hide resolved
ea1a3aa
to
85df5f8
Compare
/unhold |
fee0975
to
f199d2a
Compare
Had a internal discussion with Jan about naming. This name that we have right now is a bit confusing. This plugin interface that we have right now is called EvictorPlugin, and the first default plugin is called DefaultEvictor. But this plugin is not really meant to actually evict pods, only filter/sort/etc, which will affect eviction, but is not the eviction itself. It is something like EvictorCustomizer, or EvictorBehaviour... or something... From the user perspective, this to be called DefaultEvictor makes sense, since it feels like the user is configuring the evictor itself and how it evicts and decides to evict pods. But in code we will have one thing that is the actual evictor, and a thing that will change how the evictor filters/sorts/etc. Just wanted to throw this here. It is confusing, but I can't think of a better name. I added comments both in defaultevictor.go and the framework types.go:
I think it is sufficient, but if anybody has a better name feel free to chime in :) There is yet another naming discussion that I will bring in the other issue #924. |
type DefaultEvictorArgs struct { | ||
metav1.TypeMeta | ||
|
||
Nodes []*v1.Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nodes
param is a tricky param. It can not be passed through the plugin arguments since a plugin is initialized before its extension point is invoked. In my PoC implementation I reached for the current nodes through the shared informer: https://github.com/kubernetes-sigs/descheduler/pull/781/files#diff-66db71b98f61a3c06ca8d17cbed99626fc23f8bab081cd71a8baf0867613d4d5R111. I am open to suggestions on how to make it better. Using the shared node informer directly is acceptable solution for the moment. Nevertheless, once the descheduler is migrated into the framework completely, we need a single method for listing ready nodes which will be invoked by this plugin and the main descheduling loop. And possibly by others who needs to have identical list of ready nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue to track, and I am getting nodes from shared informers for now.
|
||
const ( | ||
PluginName = "DefaultEvictor" | ||
evictPodAnnotationKey = "descheduler.alpha.kubernetes.io/evict" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damemi the annotation has been alpha for some time. I wonder whether the annotation is still in use or whether we could drop it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely don't drop it, if anything we should probably promote it. I think this feature has shown to be useful
@knelasevero thank you for putting the comments down. Right before we introduce the v1alpha2 configuration type we will have a discussion about naming of all plugins. At that point we will need to decide which name will be the least confusing yet still sufficiently descriptive. |
a4369db
to
d51e5aa
Compare
d4cb211
to
3e9e9b3
Compare
3e9e9b3
to
861487c
Compare
/retest |
861487c
to
7e53b0f
Compare
@@ -20,7 +20,7 @@ go build -o "${OS_OUTPUT_BINPATH}/deepcopy-gen" "k8s.io/code-generator/cmd/deepc | |||
|
|||
${OS_OUTPUT_BINPATH}/deepcopy-gen \ | |||
--go-header-file "hack/boilerplate/boilerplate.go.txt" \ | |||
--input-dirs "./pkg/apis/componentconfig,./pkg/apis/componentconfig/v1alpha1,./pkg/api,./pkg/api/v1alpha1" \ | |||
--input-dirs "./pkg/apis/componentconfig,./pkg/apis/componentconfig/v1alpha1,./pkg/api,./pkg/api/v1alpha1,./pkg/framework/plugins/defaultevictor/" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a better way to get dirs where we have to generate code. I can work on that in another PR. For now I am adding manually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 definitely, this is part of the reason I was okay closing #900 and holding off on these moves for now. But if you have a way to make it better, please feel free
7e53b0f
to
bbde246
Compare
bbde246
to
f47c2c4
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ingvagabund 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 |
Add new DefaultEvictor plugin with args, and only moving the Filter extension point to it for now.
Follow ups (other PRs):
PreEvictFilter, Sort, PreEvictSort for the default Evictor plugin