koordinator icon indicating copy to clipboard operation
koordinator copied to clipboard

[proposal] call eviction API before kill container

Open j4ckstraw opened this issue 1 year ago • 1 comments

What is your proposal:

call eviction API before kill container

Why is this needed:

memoryEvict will kill container then call eviction api, this may disobey pod disruption budgets (PDB)

https://github.com/koordinator-sh/koordinator/blob/661dd71df888a7cb8e2b0891408b34225dc2ee85/pkg/koordlet/qosmanager/plugins/memoryevict/memory_evict.go#L163

Is there a suggested solution, if so, please add it:

if eviction response OK, then we kill pod/container, otherwise skip. refer https://kubernetes.io/docs/concepts/scheduling-eviction/api-eviction/#how-api-initiated-eviction-works

There is a bonus with call eviction API first, we can disable eviction by update rolebinding.

j4ckstraw avatar Nov 24 '23 11:11 j4ckstraw

reference https://github.com/kubernetes/kubernetes/blob/d61cbac69aae97db1839bd2e0e86d68f26b353a7/test/integration/evictions/evictions_test.go#L126C5-L127C13

j4ckstraw avatar Nov 27 '23 01:11 j4ckstraw