Jan Chaloupka
89541f7545
Deprecate node-selector, max-pods-to-evict-per-node and evict-local-storage-pods flags and promote then to policy v1alpha1 fields
2020-08-21 13:27:40 +02:00
Jan Chaloupka
d8251b9086
Redefine IsEvictable to be customizable for a particular strategy
...
Use WithXXX methods to extend the list of constraints to also
provide a reasonable error message.
2020-08-19 11:21:26 +02:00
Jan Chaloupka
a7c51ffae0
Promote Namespaces field to a pointer
2020-08-13 18:38:46 +02:00
Kubernetes Prow Robot
9746fd300f
Merge pull request #364 from lixiang233/ft_allow_custom_priority_threshold
...
Allow custom priority threshold
2020-08-12 07:35:45 -07:00
lixiang
0fdaac6042
Strategy: Set threshold priority from strategy's parameters
2020-08-12 13:54:57 +08:00
lixiang
95ce2a4ff7
PodEvictor: add a new param thresholdPriority to IsEvictable
2020-08-11 09:57:26 +08:00
Mike Dame
ec4c5bed5d
Add check for ownerref length in DuplicatePods strategy
...
This fixes a panic that occurs if a pod has no ownerrefs
later on in the strategy. If a pod has no ownerrefs, there's
nothing for us to do with it.
2020-08-10 09:37:05 -04:00
lixiang
ae38aa63af
StrategyParameters: Add new param ThresholdPriority and ThresholdPriorityClassName
2020-08-07 13:53:29 +08:00
lixiang
a5eb9fc36d
Add missing validation in PodAntiAffinity
2020-07-30 16:44:03 +08:00
Kubernetes Prow Robot
d0fbebb77c
Merge pull request #337 from damemi/rebase-1.19
...
Rebase k8s dependencies to 1.19-rc.2
2020-07-28 10:47:47 -07:00
Kubernetes Prow Robot
b799ed074a
Merge pull request #361 from jjmengze/patch-1
...
remove unnecessary line feed in log messages
2020-07-28 09:19:48 -07:00
MengZeLee
6ac81e0b9c
remove unnecessary line feed in log messages
...
If we remove these \n, there will be no misspell errors in go report
2020-07-28 23:27:23 +08:00
Mike Dame
5bb0389538
Update API scheme registration for 1.19
2020-07-28 10:24:21 -04:00
Jan Chaloupka
11f1333af7
ListPodsOnANode: allow to include/exclude namespaces
...
Info: field selector is still not properly mocked so it's not possible to unit test it
2020-07-21 15:08:05 +02:00
Jan Chaloupka
74f70fdbc9
ListPodsOnANode: define Options type to pass various options
...
Options like:
- filter
- included/excluded namespaces
- labels
2020-07-21 15:07:45 +02:00
Jan Chaloupka
0006fb039d
ListPodsOnANode: have one function parameter per each line
2020-07-21 15:02:34 +02:00
Kubernetes Prow Robot
05c69ee26a
Merge pull request #336 from lixiang233/avoid_duplicated_append_RemoveDuplicatePods
...
avoid appending list multiple times in RemoveDuplicates
2020-07-09 01:32:02 -07:00
Kubernetes Prow Robot
1623e09122
Merge pull request #332 from lixiang233/fix_test_struct_lownodeutilization
...
Add maxPodsToEvictPerNode to LowNodeUtilization testcase struct
2020-07-09 01:22:02 -07:00
lixiang
696aa7c505
rename maxPodsToEvict to maxPodsToEvictPerNode to avoid misunderstanding
2020-07-08 15:15:48 +08:00
lixiang
c53dce0805
Add maxPodsToEvictPerNode to testcase struct
2020-07-08 15:15:38 +08:00
lixiang
cd8b5a0354
avoid appending list multiple times in RemoveDuplicates
2020-07-07 14:42:53 +08:00
lixiang
ae3b4368ee
support only one sorting strategy in lowNodeUtilization
2020-07-01 09:47:35 +08:00
Kubernetes Prow Robot
267b0837dc
Merge pull request #327 from farah/farah/klog-migration
...
Update klog to v2
2020-06-23 08:35:40 -07:00
Kubernetes Prow Robot
c713537d56
Merge pull request #322 from lixiang233/move_pod_sort
...
Move sortPodsBasedOnPriority to pod util
2020-06-22 12:21:40 -07:00
Ali Farah
15fcde5229
Update klog to v2
2020-06-22 20:43:22 +10:00
lixiang
65a03e76bf
Add sorting to RemovePodsViolatingInterPodAntiAffinity
2020-06-19 14:11:23 +08:00
lixiang
43525f6493
Move sortPodsBasedOnPriority to podutil
2020-06-16 19:19:03 +08:00
lixiang
7457626f62
Move helper funcs to testutil
2020-06-16 19:17:28 +08:00
Sean Malloy
4ff533ec17
Add pod eviction reason to k8s events
...
Prior to this change the event created for every pod eviction was
identical. Instead leverage the newly added eviction reason when
creating k8s events. This makes it easier for end users to understand
why the descheduler evicted a pod when inspecting k8s events.
2020-06-10 01:13:17 -05:00
Sean Malloy
7680e3d079
Use var declaration instead of short assignmnet
...
This is a very minor refactor to use a var declaration for the reason
variable. A var declaration is being used because the zero value for
strings is an empty string.
https://golang.org/ref/spec#The_zero_value
2020-06-10 01:05:05 -05:00
Mike Dame
9951b85d60
Add optional reason parameter to EvictPod
2020-06-09 13:35:51 -04:00
Mike Dame
ff21ec9432
Remove redundant eviction log message
2020-06-09 12:17:45 -04:00
Kubernetes Prow Robot
5e15d77bf2
Merge pull request #309 from damemi/change-evict-local-storage-pods
...
Make evictLocalStoragePods a property of PodEvictor
2020-06-08 03:53:46 -07:00
Kubernetes Prow Robot
795a80dfb0
Merge pull request #310 from lixiang233/ignore_no_evictable_pod_node
...
Skip evicting when no evictable pod found on node
2020-06-05 07:41:44 -07:00
Mike Dame
f5e4acdd8a
Make evictLocalStoragePods a property of PodEvictor
...
This is a minor refactor of PodEvictor to include evictLocalStoragePods as a
property (so that it doesn't need to be passed to each strategy function.) It
also removes ListEvictablePodsOnNode and extends ListPodsOnANode with an optional
"filter" function parameter, so that for example IsEvictable can be passed to it
and achieve the same results as the function formerly known as ListEvictablePodsOnNode.
This approach also now allows strategies to more explicitly extend their criteria of what
IsEvictable considers an evictable pod (such as NodeAffinity, which checks that the pod
can fit on any other node).
2020-06-05 10:28:48 -04:00
lixiang
eb9d974a8b
pass golint check for pkg/descheduler/strategies/
2020-06-04 14:33:24 +08:00
lixiang
d41a1f4a56
Ignore evicting when no evictable pod found on node
2020-06-04 10:31:15 +08:00
Kubernetes Prow Robot
bd412bf87f
Merge pull request #300 from damemi/refactor-is-evictable
...
Add more verbose logging to IsEvictable checks
2020-05-29 10:03:16 -07:00
Mike Dame
0a4b8b0a25
Add more verbose logging to IsEvictable checks
2020-05-29 10:20:14 -04:00
Jan Chaloupka
abdf79454f
Add missing address of api.StrategyParameters
...
https://github.com/kubernetes-sigs/descheduler/pull/285 got merged before re-running the unit tests.
2020-05-29 13:34:57 +02:00
Kubernetes Prow Robot
46b570b71d
Merge pull request #296 from ingvagabund/make-Params-a-pointer
...
Make DeschedulerStrategy.Params a pointer
2020-05-28 22:53:15 -07:00
Kubernetes Prow Robot
616a9b5f6b
Merge pull request #285 from lixiang233/Ft_change_lowUtilization_break
...
Change break condition and thresholds validation for lowUtilization
2020-05-28 07:36:02 -07:00
Kubernetes Prow Robot
003a4cdc2b
Merge pull request #302 from lixiang233/clean_up_strategy_enable_check
...
Clean up code in LowNodeUtilization
2020-05-28 07:16:02 -07:00
lixiang
d0eea0cabb
Clean up code in LowNodeUtilization
2020-05-28 10:35:46 +08:00
Mike Dame
f0297dfe03
Standardize node affinity strategy logs
2020-05-27 16:52:16 -04:00
Jan Chaloupka
5a81a0661b
Make DeschedulerStrategy.Params a pointer
...
To avoid empty params fields when serializing:
RemoveDuplicates:
enabled: true
params: {}
RemovePodsHavingTooManyRestarts:
enabled: true
params:
podsHavingTooManyRestarts: {}
RemovePodsViolatingInterPodAntiAffinity:
enabled: true
params: {}
RemovePodsViolatingNodeAffinity:
enabled: true
params:
nodeAffinityType:
- requiredDuringSchedulingIgnoredDuringExecution
RemovePodsViolatingNodeTaints:
enabled: true
params: {}
2020-05-27 10:31:31 +02:00
lixiang
2a8dc69cbb
Stop condition and config validation change for lowUtilization
...
1.Set default CPU/Mem/Pods percentage of thresholds to 100
2.Stop evicting pods if any resource ran out
3.Add thresholds verification method and limit resource percentage within [0, 100]
4.Change testcases and readme
2020-05-25 19:03:37 +08:00
Jan Chaloupka
eacbae72fd
Mention pod eviction is in dry mode when set
...
Indicate whether a pod is only virtually evicted so there's no confusion
with the real eviction.
2020-05-20 10:40:58 +02:00
Mike Dame
c6ff87dbd6
Consider pod image in duplicates strategy
...
This increases the specificity of the RemoveDuplicates strategy by
removing pods which not only have the same owner, but who also
must have the same list of container images. This also adds a
parameter, `ExcludeOwnerKinds` to the RemoveDuplicates strategy
which accepts a list of Kinds. If a pod has any of these Kinds as
an owner, that pod is not considered for eviction.
2020-05-15 09:37:09 -04:00
Sean Malloy
55afde6251
Remove line break in log message from PodLifeTime strategy
2020-05-14 00:36:52 -05:00