Skip to content

Commit 398dc7e

Browse files
Merge pull request #946 from dashpole/priority_eviction
Modify Eviction Strategy to take Priority into account
2 parents de0f3c3 + 0d66c85 commit 398dc7e

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

contributors/design-proposals/kubelet-eviction.md

+25-14
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,22 @@ the `kubelet` will select a subsequent pod.
241241

242242
## Eviction Strategy
243243

244+
The `kubelet` will implement an eviction strategy oriented around
245+
[Priority](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/pod-priority-api.md)
246+
and pod usage relative to requests. It will target pods that are the lowest
247+
Priority, and are the largest consumers of the starved resource relative to
248+
their scheduling request.
249+
250+
It will target pods whose usage of the starved resource exceeds its requests.
251+
Of those pods, it will rank by a function of priority, and usage - requests.
252+
Roughly speaking, if a pod has twice the priority of another pod, it will
253+
recieve half the penalty for usage above requests. If system daemons are
254+
exceeding their allocation (see [Strategy Caveat](strategy-caveat) below),
255+
and all pods are using less than their requests, then it will evict a pod
256+
whose usage is less than requests, based on the function of priority, and
257+
usage - requests.
258+
259+
Prior to v1.8:
244260
The `kubelet` will implement a default eviction strategy oriented around
245261
the pod quality of service class.
246262

@@ -258,14 +274,16 @@ starved resource.
258274
relative to their request are killed first. If no pod has exceeded its request,
259275
the strategy targets the largest consumer of the starved resource.
260276

261-
A guaranteed pod is guaranteed to never be evicted because of another pod's
262-
resource consumption. That said, guarantees are only as good as the underlying
263-
foundation they are built upon. If a system daemon
277+
### Strategy Caveat
278+
279+
A pod consuming less resources than its requests is guaranteed to never be
280+
evicted because of another pod's resource consumption. That said, guarantees
281+
are only as good as the underlying foundation they are built upon. If a system daemon
264282
(i.e. `kubelet`, `docker`, `journald`, etc.) is consuming more resources than
265-
were reserved via `system-reserved` or `kube-reserved` allocations, and the node
266-
only has guaranteed pod(s) remaining, then the node must choose to evict a
267-
guaranteed pod in order to preserve node stability, and to limit the impact
268-
of the unexpected consumption to other guaranteed pod(s).
283+
were reserved via `system-reserved` or `kube-reserved` allocations, then the node
284+
must choose to evict a pod, even if it is consuming less than its requests.
285+
It must take action in order to preserve node stability, and to limit the impact
286+
of the unexpected consumption to other well-behaved pod(s).
269287

270288
## Disk based evictions
271289

@@ -458,13 +476,6 @@ for eviction. Instead `DaemonSet` should ideally include Guaranteed pods only.
458476
The pod eviction may evict more pods than needed due to stats collection timing gap. This can be mitigated by adding
459477
the ability to get root container stats on an on-demand basis (https://github.com/google/cadvisor/issues/1247) in the future.
460478

461-
### How kubelet ranks pods for eviction in response to inode exhaustion
462-
463-
At this time, it is not possible to know how many inodes were consumed by a particular container. If the `kubelet` observes
464-
inode exhaustion, it will evict pods by ranking them by quality of service. The following issue has been opened in cadvisor
465-
to track per container inode consumption (https://github.com/google/cadvisor/issues/1422) which would allow us to rank pods
466-
by inode consumption. For example, this would let us identify a container that created large numbers of 0 byte files, and evict
467-
that pod over others.
468479

469480
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
470481
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/kubelet-eviction.md?pixel)]()

0 commit comments

Comments
 (0)