If both a burstable and best-effort containers are in need of compute resource, is there any priority that kubernetes follows?

8/7/2018

I will explain my question using an example.

Suppose in a node (with capacity X+1 cpu, Y+1 memory) there are two containers, 1 Burstable type container and the other best-effort type.

If the burstable container (configured as X cpu request, Y memory request) is already using X cpu, Y memory of the node.

What happens next when both Burstable and Best-effort request for that unused 1 cpu, 1 memory of the node. Will Kubernetes give priority to Burstable container over Best-effort or is it random.

Note: My question is not regarding eviction of a process but regarding which container will get the unused 1 cpu.

-- Kaladin
containers
kubernetes

1 Answer

8/7/2018

From : https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/resource-qos.md

Pods will not be killed if CPU guarantees cannot be met (for example if system tasks or daemons take up lots of CPU), they will be temporarily throttled.

Memory is an incompressible resource and so let's discuss the semantics of memory management a bit.

Best-Effort pods will be treated as lowest priority. Processes in these pods are the first to get killed if the system runs out of memory. These containers can use any amount of free memory in the node though.

Guaranteed pods are considered top-priority and are guaranteed to not be killed until they exceed their limits, or if the system is under memory pressure and there are no lower priority containers that can be evicted.

Burstable pods have some form of minimal resource guarantee, but can use more resources when available. Under system memory pressure, these containers are more likely to be killed once they exceed their requests and no Best-Effort pods exist.

So it seems Burstable pods will have priority over Best Effort pods.

-- Harshal Shah
Source: StackOverflow