mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
reject pods when under disk pressure
This commit is contained in:
parent
3d7318f29d
commit
372bf95a4f
@ -137,8 +137,10 @@ func (m *managerImpl) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAd
|
|||||||
if kubelettypes.IsCriticalPod(attrs.Pod) {
|
if kubelettypes.IsCriticalPod(attrs.Pod) {
|
||||||
return lifecycle.PodAdmitResult{Admit: true}
|
return lifecycle.PodAdmitResult{Admit: true}
|
||||||
}
|
}
|
||||||
// the node has memory pressure, admit if not best-effort
|
|
||||||
if hasNodeCondition(m.nodeConditions, v1.NodeMemoryPressure) {
|
// Conditions other than memory pressure reject all pods
|
||||||
|
nodeOnlyHasMemoryPressureCondition := hasNodeCondition(m.nodeConditions, v1.NodeMemoryPressure) && len(m.nodeConditions) == 1
|
||||||
|
if nodeOnlyHasMemoryPressureCondition {
|
||||||
notBestEffort := v1.PodQOSBestEffort != v1qos.GetPodQOS(attrs.Pod)
|
notBestEffort := v1.PodQOSBestEffort != v1qos.GetPodQOS(attrs.Pod)
|
||||||
if notBestEffort {
|
if notBestEffort {
|
||||||
return lifecycle.PodAdmitResult{Admit: true}
|
return lifecycle.PodAdmitResult{Admit: true}
|
||||||
|
Loading…
Reference in New Issue
Block a user