-
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
Drop deprecated flags #662
Drop deprecated flags #662
Conversation
[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 |
f4d2dc9
to
bd6ab59
Compare
pkg/apis/componentconfig/types.go
Outdated
NodeSelector string | ||
|
||
// MaxNoOfPodsToEvictPerNode restricts maximum of pods to be evicted per node. | ||
MaxNoOfPodsToEvictPerNode int | ||
|
||
// EvictLocalStoragePods allows pods using local storage to be evicted. | ||
EvictLocalStoragePods bool | ||
|
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.
I'd like to figure out our eventual plan for the componentconfig types. I started an issue for it a while back here #431, but I don't know if it's just redundant with Policy
or what
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.
Good point. I will put those back.
maxNoOfPodsToEvictPerNode := rs.MaxNoOfPodsToEvictPerNode | ||
if deschedulerPolicy.MaxNoOfPodsToEvictPerNode != nil { | ||
maxNoOfPodsToEvictPerNode = *deschedulerPolicy.MaxNoOfPodsToEvictPerNode | ||
} | ||
|
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.
shouldn't we keep this nil check instead of passing the variable directly?
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.
I check for the nil inside the pod evictor
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.
I noticed that after I commented here, sorry. Still, is there any reason not to do that check earlier with the rest of the flags that are checked similarly here?
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.
Nil is a valid value
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.
Got it, the other thread cleared that up for me too thanks
@@ -110,9 +110,9 @@ func (pe *PodEvictor) EvictPod(ctx context.Context, pod *v1.Pod, node *v1.Node, | |||
if len(reasons) > 0 { | |||
reason += " (" + strings.Join(reasons, ", ") + ")" | |||
} | |||
if pe.maxPodsToEvictPerNode > 0 && pe.nodepodCount[node]+1 > pe.maxPodsToEvictPerNode { |
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.
I believe this was checking >0
because the default of 0 = unlimited
. So, removing this and making nil the default changes the existing behavior. I think we should still respect 0 as no limit
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.
Based on https://github.com/kubernetes-sigs/descheduler#policy-and-strategies:
The policy includes a common configuration that applies to all the strategies:
Name | Default Value | Description |
---|---|---|
nodeSelector |
nil |
limiting the nodes which are processed |
evictLocalStoragePods |
false |
allows eviction of pods with local storage |
evictSystemCriticalPods |
false |
[Warning: Will evict Kubernetes system pods] allows eviction of pods with any priority, including system pods like kube-dns |
ignorePvcPods |
false |
set whether PVC pods should be evicted or ignored |
maxNoOfPodsToEvictPerNode |
nil |
maximum number of pods evicted from each node (summed through all strategies) |
maxNoOfPodsToEvictPerNode
is nil by default and there's no mention of 0 being the unlimited case. Also, using 0 for unlimited is not intuitive since without any other information setting it to 0 is like saying "do not evict any pod from any 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.
Ah okay, I was looking at the componentconfig types where it wasn't a pointer. So, 0 was just unlimited for the internal representation. Sounds good
bd6ab59
to
55bd28a
Compare
55bd28a
to
006da00
Compare
006da00
to
73a7adf
Compare
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.
/lgtm
…ed-flags Drop deprecated flags
To drop https://github.com/kubernetes-sigs/descheduler/blob/master/cmd/descheduler/app/options/options.go#L89-L93: