help wantedkind/cleanupsig/nodetriage/accepted
描述
Constructing a new schedulerframework.NodeInfo is a fairly heavy operation: iterate through every resource in every container 3 times (desired, actual & allocated) in every pod and add them all up. The Kubelet does this on every admission request, but also every time it retries a pending resize.
Fortunately the NodeInfo is designed to be cached, which is what the scheduler does. We should consider caching it in the Kubelet too. To keep the cache up-to-date, it will need to be updated:
- when a pod is added
- when a pod's allocation changes (resized)
- when a pod becomes inactive (see
kubelet.filterOutInactivePods) - when a pods status resources change (resize is actuated)
/sig node /kind cleanup
/cc @natasha41575