You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VPA: Revert changes that related to disruption/disruptionless changes
Because of kubernetes#7813, this commit reverts a lot of the changes that introducted logic that involved actuating in-place updates based on the containerResizePolicy.
Signed-off-by: Max Cao <[email protected]>
// If some of these are populated, we know it at least understands resizing
452
-
iflen(container.ResizePolicy) >0 {
453
-
noRestartPoliciesPopulated=false
454
-
}
455
-
456
-
for_, policy:=rangecontainer.ResizePolicy {
457
-
ifpolicy.RestartPolicy!=apiv1.NotRequired {
458
-
klog.V(4).InfoS("in-place resize of pod will cause container disruption, because of container resize policy", "pod", klog.KObj(pod), "container", container.Name, "containerResizeRestartPolicy", policy.RestartPolicy)
459
-
ifisPodRestartPolicyNever {
460
-
klog.InfoS("in-place resize of pod not possible, container resize policy and pod restartPolicy conflict", "pod", klog.KObj(pod), "container", container.Name, "containerResizeRestartPolicy", policy.RestartPolicy, "podRestartPolicy", pod.Spec.RestartPolicy)
461
-
returnfalse
462
-
}
463
-
}
449
+
ifcontainer.ResizePolicy==nil {
450
+
klog.InfoS("Can't resize pod, container resize policy does not exist; is InPlacePodVerticalScaling enabled?", "pod", klog.KObj(pod))
451
+
returnfalse
464
452
}
465
453
}
466
454
467
-
// If none of the policies are populated, our feature is probably not enabled, so we can't in-place regardless
468
-
ifnoRestartPoliciesPopulated {
469
-
klog.InfoS("impossible to resize pod in-place, container resize policies are not populated", "pod", klog.KObj(pod))
klog.V(4).InfoS("Pod can be resized in-place; more pods are running than required", "podName", pod.Name, "shouldBeAlive", shouldBeAlive, "actuallyAlive", actuallyAlive)
479
+
klog.V(4).InfoS("Pod can be resized in-place; more pods are running than required", "pod", klog.KObj(pod), "shouldBeAlive", shouldBeAlive, "actuallyAlive", actuallyAlive)
497
480
returntrue
498
481
}
499
482
500
483
// If all pods are running, no pods are being evicted or updated, and eviction tolerance is small, we can resize in-place
// Although this seems like a big API change (wouldn't work for VPA on kubernetes < 1.33 without feature gate applied). I'll leave it up for reviewers.
83
+
// IMO, this should probably be implemented for a followup enhancement.
88
84
89
85
// Statuses can be missing, or status resources can be nil
0 commit comments