How are Kubernetes Ressource Requests handled in practice, if the "owner" does not use these resources, but another pod would require them? Will they temporarily be granted to the other ressource or do they lead to idle status?
Example: Given two Pods/Deployments (on the same node):
Pod A crashes internally, so will never use any ressources (actual usage 0%). Questions:
I have not found any docs explaining this in details (they only talk about schedlung based on resources), any links would be very much appreciated...Background/Motivation: I have an extremely slow node app on a pod and I suspect this is realated to Resource Request/Limits... Thanks very much!
In the node, the only things that kubernetes have is kubelet, kube proxy and the container runtime wich is responsible to enforce the limits established by kubernetes. So how the limits are enforced depends on wich container runtime you have in kubernetes. Let's suppose your are using Docker. Then get inside your node and check how Docker is establishing limits to your pod. for example memory limits : docker inspect -f "{{.HostConfig.Memory}}"
Resource requests only affect pods placement on nodes. In your example, the node has 100% CPU requests worth of pods on it, so (assuming the node has 1 CPU) nothing else can get scheduled there.
CPU limits throttle the process running. If B is in a busy loop of some sort, it will never get more than 80% CPU. It could use all of that 80% CPU, even if it only requested 60% and other scheduled pods have requested the other 40%; only the limit matters here. It could get less, if A is also trying to use 40% or 100%; the kernel will allocate things according to its own policy.
(Memory works similarly, except that the kernel can't time-slice memory if the system is overcommitted, so it will kill off an arbitrary process, usually the one with the highest memory usage.)