kubelete端:
创建eviction manager然后一直的去执行synchronize,synchronize函数会去计算node的是否超过阈值,没有则返回,过一段时间在计算,有超过则killpod.hardEvicthon则过一段时间再去
计算节点阈值情况:
// determine the set of resources under starvation
starvedResources := reclaimResources(thresholds)
if len(starvedResources) == 0 {
glog.V(3).Infof("eviction manager: no resources are starved")
return
}
soft的eviction是通过过滤graceperiod时间还是满足threshold,则进行evict
hard的监控到超过threshold则直接进行evict
综上:soft和hard的处理是通过threshold的GracePeriod成员,并设置其值,0表示hard,其他表示soft,并根据这个threshold来排序activepod,每次执行synchronize只删除一个pod.
本文深入探讨了Kubernetes中EvictionManager的工作原理,详细解释了如何通过soft和hard阈值判断节点资源是否处于饥饿状态,以及如何根据GracePeriod成员的设置决定Pod的驱逐策略。
2699

被折叠的 条评论
为什么被折叠?



