kubernetes/kubernetes

Cache NodeInfo for Kubelet admission

Open

#132,858 创建于 2025年7月10日

在 GitHub 查看
 (13 评论) (0 反应) (3 负责人)Go (122,268 star) (43,066 fork)batch import
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

贡献者指南

Cache NodeInfo for Kubelet admission · kubernetes/kubernetes#132858 | Good First Issue