General question around CPU scheduling that I want to make absolutely sure on.
Scenario I have 300 cores available on my worker nodes.
Peak minimum container CPU request 300 max 600
(I know this scenario is off because you would scale down resources but humor me)
At peak all 300 cores are allocated to containers I have 25 containers though that each have a minimum of 4 cores requested but the vast majority of the time they are only using 1 core. If most of the time 75% of their resources are idle can another container burst to use their capacity until they actually need it or are those minimum resources explicitly reserved so even if they are idle no other already provisioned container can use it?
Okay maybe ask a different way as I am getting no responses. If I have a container that has a minimum cpu of 4 and max of 8. If that container is only every using 1 core out of the 4 minimum then can another container burst to use that capacity or is that minimum 4 a hard reservation and will sit there idle for when the container needs it?
I don’t have much experience with this but my understanding is that the CPU resources are not “pre-allocated” if thats an OK term to use. Kubernetes just does the math to say these containers can fit on these nodes given their combined CPU request
. Even if all the containers were idle Kubernetes will not scheduled another pod to that node if the CPU request
is higher than the node can handle, because when all containers are active it can’t guarantee the CPU request
of all them.
But the spare CPU capacity of a container using 1 of its 4 CPU request
can be used by other containers to burst up to their CPU limit
. When the container needs to use the full 4 cores then other containers will be throttled back towards their CPU request
as needed.
I’m open to correction
Kind regards,
Stephen