mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Gate: disallow in-place resize for guaranteed pods on nodes with a static topology policy
New gate "InPlacePodVerticalScalingExclusiveCPUs" is off by default, but can be enabled to unblock development of Static CPU management alongside InPlacePodVerticalScaling.
This commit is contained in:
parent
af41aa1d9f
commit
2d8939c4ae
@ -270,6 +270,14 @@ const (
|
|||||||
// InPlacePodVerticalScaling also be enabled.
|
// InPlacePodVerticalScaling also be enabled.
|
||||||
InPlacePodVerticalScalingAllocatedStatus featuregate.Feature = "InPlacePodVerticalScalingAllocatedStatus"
|
InPlacePodVerticalScalingAllocatedStatus featuregate.Feature = "InPlacePodVerticalScalingAllocatedStatus"
|
||||||
|
|
||||||
|
// owner: @tallclair @esotsal
|
||||||
|
// alpha: v1.32
|
||||||
|
//
|
||||||
|
// Allow resource resize for containers in Guaranteed pods with integer CPU requests ( default false ).
|
||||||
|
// Applies only in nodes with InPlacePodVerticalScaling and CPU Manager features enabled, and
|
||||||
|
// CPU Manager Static Policy option set.
|
||||||
|
InPlacePodVerticalScalingExclusiveCPUs featuregate.Feature = "InPlacePodVerticalScalingExclusiveCPUs"
|
||||||
|
|
||||||
// owner: @trierra
|
// owner: @trierra
|
||||||
//
|
//
|
||||||
// Disables the Portworx in-tree driver.
|
// Disables the Portworx in-tree driver.
|
||||||
|
@ -397,6 +397,10 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
|||||||
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
|
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
InPlacePodVerticalScalingExclusiveCPUs: {
|
||||||
|
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
|
||||||
|
},
|
||||||
|
|
||||||
InTreePluginPortworxUnregister: {
|
InTreePluginPortworxUnregister: {
|
||||||
{Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha},
|
{Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha},
|
||||||
},
|
},
|
||||||
|
@ -2838,6 +2838,21 @@ func isPodResizeInProgress(pod *v1.Pod, podStatus *kubecontainer.PodStatus) bool
|
|||||||
// pod should hold the desired (pre-allocated) spec.
|
// pod should hold the desired (pre-allocated) spec.
|
||||||
// Returns true if the resize can proceed.
|
// Returns true if the resize can proceed.
|
||||||
func (kl *Kubelet) canResizePod(pod *v1.Pod) (bool, v1.PodResizeStatus) {
|
func (kl *Kubelet) canResizePod(pod *v1.Pod) (bool, v1.PodResizeStatus) {
|
||||||
|
if v1qos.GetPodQOS(pod) == v1.PodQOSGuaranteed && !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScalingExclusiveCPUs) {
|
||||||
|
if utilfeature.DefaultFeatureGate.Enabled(features.CPUManager) {
|
||||||
|
if kl.containerManager.GetNodeConfig().CPUManagerPolicy == "static" {
|
||||||
|
klog.V(3).InfoS("Resize is infeasible for Guaranteed Pods alongside CPU Manager static policy")
|
||||||
|
return false, v1.PodResizeStatusInfeasible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if utilfeature.DefaultFeatureGate.Enabled(features.MemoryManager) {
|
||||||
|
if kl.containerManager.GetNodeConfig().ExperimentalMemoryManagerPolicy == "static" {
|
||||||
|
klog.V(3).InfoS("Resize is infeasible for Guaranteed Pods alongside Memory Manager static policy")
|
||||||
|
return false, v1.PodResizeStatusInfeasible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
node, err := kl.getNodeAnyWay()
|
node, err := kl.getNodeAnyWay()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.ErrorS(err, "getNodeAnyway function failed")
|
klog.ErrorS(err, "getNodeAnyway function failed")
|
||||||
|
@ -522,6 +522,12 @@
|
|||||||
lockToDefault: false
|
lockToDefault: false
|
||||||
preRelease: Alpha
|
preRelease: Alpha
|
||||||
version: "1.32"
|
version: "1.32"
|
||||||
|
- name: InPlacePodVerticalScalingExclusiveCPUs
|
||||||
|
versionedSpecs:
|
||||||
|
- default: false
|
||||||
|
lockToDefault: false
|
||||||
|
preRelease: Alpha
|
||||||
|
version: "1.32"
|
||||||
- name: InTreePluginPortworxUnregister
|
- name: InTreePluginPortworxUnregister
|
||||||
versionedSpecs:
|
versionedSpecs:
|
||||||
- default: false
|
- default: false
|
||||||
|
Loading…
Reference in New Issue
Block a user