diff --git a/go.mod b/go.mod index 83c2402918..b2370a3f32 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/google/uuid v1.3.0 github.com/h2non/gock v1.2.0 github.com/klauspost/cpuid/v2 v2.2.6 - github.com/kubewharf/katalyst-api v0.5.1-0.20240816033534-930640a4d608 + github.com/kubewharf/katalyst-api v0.5.1-0.20240820031712-7c1239991078 github.com/montanaflynn/stats v0.7.1 github.com/opencontainers/runc v1.1.6 github.com/opencontainers/selinux v1.10.0 diff --git a/go.sum b/go.sum index 3771f2ffdc..8e788129c3 100644 --- a/go.sum +++ b/go.sum @@ -568,8 +568,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubewharf/katalyst-api v0.5.1-0.20240816033534-930640a4d608 h1:9e+TkjTyn4IKvtcqJaxxsiHQkx0DyKbrWcPf3zcbUhY= -github.com/kubewharf/katalyst-api v0.5.1-0.20240816033534-930640a4d608/go.mod h1:Y2IeIorxQamF2a3oa0+URztl5QCSty6Jj3zD83R8J9k= +github.com/kubewharf/katalyst-api v0.5.1-0.20240820031712-7c1239991078 h1:CSBXQOe0AzlWcGaww8uqOUDu+/4bL3hVNBz86oziOis= +github.com/kubewharf/katalyst-api v0.5.1-0.20240820031712-7c1239991078/go.mod h1:Y2IeIorxQamF2a3oa0+URztl5QCSty6Jj3zD83R8J9k= github.com/kubewharf/kubelet v1.24.6-kubewharf.9 h1:jOTYZt7h/J7I8xQMKMUcJjKf5UFBv37jHWvNp5VRFGc= github.com/kubewharf/kubelet v1.24.6-kubewharf.9/go.mod h1:MxbSZUx3wXztFneeelwWWlX7NAAStJ6expqq7gY2J3c= github.com/kyoh86/exportloopref v0.1.7/go.mod h1:h1rDl2Kdj97+Kwh4gdz3ujE7XHmH51Q0lUiZ1z4NLj8= diff --git a/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go b/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go index 6c7ccde733..436d12d8ed 100644 --- a/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go +++ b/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go @@ -830,7 +830,7 @@ func (p *DynamicPolicy) Allocate(ctx context.Context, }() allocationInfo := p.state.GetAllocationInfo(req.PodUid, req.ContainerName) - if allocationInfo != nil && allocationInfo.OriginalAllocationResult.Size() >= reqInt && !util.PodIsInVPAResizing(req) { + if allocationInfo != nil && allocationInfo.OriginalAllocationResult.Size() >= reqInt && !util.PodInplaceUpdateResizing(req) { general.InfoS("already allocated and meet requirement", "podNamespace", req.PodNamespace, "podName", req.PodName, @@ -1150,7 +1150,7 @@ func (p *DynamicPolicy) getContainerRequestedCores(allocationInfo *state.Allocat // if there is these two annotations in memory state, it is a new pod, // we don't need to check the pod request from podWatcher if allocationInfo.Annotations[consts.PodAnnotationAggregatedRequestsKey] != "" || - allocationInfo.Annotations[consts.PodAnnotationVPAResizingKey] != "" { + allocationInfo.Annotations[consts.PodAnnotationInplaceUpdateResizingKey] != "" { return allocationInfo.RequestQuantity } if state.CheckNUMABinding(allocationInfo) { diff --git a/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_allocation_handlers.go b/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_allocation_handlers.go index 7871989475..6df549ebd6 100644 --- a/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_allocation_handlers.go +++ b/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_allocation_handlers.go @@ -140,7 +140,7 @@ func (p *DynamicPolicy) sharedCoresWithoutNUMABindingAllocationHandler(_ context } } } else if allocationInfo.RampUp { - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s is still in ramp up, not allow to VPA resize", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("pod is still ramp up, not allow to VPA resize") @@ -154,15 +154,15 @@ func (p *DynamicPolicy) sharedCoresWithoutNUMABindingAllocationHandler(_ context allocationInfo.TopologyAwareAssignments = pooledCPUsTopologyAwareAssignments allocationInfo.OriginalTopologyAwareAssignments = machine.DeepcopyCPUAssignment(pooledCPUsTopologyAwareAssignments) } else { - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { general.Infof("pod: %s/%s, container: %s request to VPA resize (%.02f->%.02f)", req.PodNamespace, req.PodName, req.ContainerName, allocationInfo.RequestQuantity, reqFloat64) allocationInfo.RequestQuantity = reqFloat64 p.state.SetAllocationInfo(allocationInfo.PodUid, allocationInfo.ContainerName, allocationInfo) - _, err := p.doAndCheckPutAllocationInfoPodVPAResizingAware(originAllocationInfo, allocationInfo, false, true) + _, err := p.doAndCheckPutAllocationInfoPodResizingAware(originAllocationInfo, allocationInfo, false, true) if err != nil { - general.Errorf("pod: %s/%s, container: %s doAndCheckPutAllocationInfoPodVPAResizingAware failed: %q", + general.Errorf("pod: %s/%s, container: %s doAndCheckPutAllocationInfoPodResizingAware failed: %q", req.PodNamespace, req.PodName, req.ContainerName, err) p.state.SetAllocationInfo(originAllocationInfo.PodUid, originAllocationInfo.ContainerName, originAllocationInfo) return nil, err @@ -210,7 +210,7 @@ func (p *DynamicPolicy) reclaimedCoresAllocationHandler(_ context.Context, return nil, fmt.Errorf("reclaimedCoresAllocationHandler got nil request") } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { return nil, fmt.Errorf("not support VPA resize for reclaimed cores") } @@ -301,7 +301,7 @@ func (p *DynamicPolicy) dedicatedCoresAllocationHandler(ctx context.Context, return nil, fmt.Errorf("dedicatedCoresAllocationHandler got nil req") } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { return nil, fmt.Errorf("not support VPA resize for dedicated cores") } @@ -632,7 +632,7 @@ func (p *DynamicPolicy) allocateSharedNumaBindingCPUs(req *pluginapi.ResourceReq RequestQuantity: reqFloat64, } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { originAllocationInfo := p.state.GetAllocationInfo(allocationInfo.PodUid, allocationInfo.ContainerName) if originAllocationInfo == nil { general.Errorf("pod: %s/%s, container: %s request to cpu VPA resize alloation, but no origin allocation info, reject it", @@ -643,9 +643,9 @@ func (p *DynamicPolicy) allocateSharedNumaBindingCPUs(req *pluginapi.ResourceReq general.Infof("pod: %s/%s, container: %s request to cpu VPA resize allocation (%.02f->%.02f)", req.PodNamespace, req.PodName, req.ContainerName, originAllocationInfo.RequestQuantity, allocationInfo.RequestQuantity) p.state.SetAllocationInfo(allocationInfo.PodUid, allocationInfo.ContainerName, allocationInfo) - checkedAllocationInfo, err := p.doAndCheckPutAllocationInfoPodVPAResizingAware(originAllocationInfo, allocationInfo, false, true) + checkedAllocationInfo, err := p.doAndCheckPutAllocationInfoPodResizingAware(originAllocationInfo, allocationInfo, false, true) if err != nil { - general.Errorf("pod: %s/%s, container: %s request to cpu VPA resize allocation, but doAndCheckPutAllocationInfoPodVPAResizingAware failed: %q", + general.Errorf("pod: %s/%s, container: %s request to cpu VPA resize allocation, but doAndCheckPutAllocationInfoPodResizingAware failed: %q", req.PodNamespace, req.PodName, req.ContainerName, err) p.state.SetAllocationInfo(originAllocationInfo.PodUid, originAllocationInfo.ContainerName, originAllocationInfo) return nil, fmt.Errorf("doAndCheckPutAllocationInfo failed with error: %v", err) @@ -667,11 +667,11 @@ func (p *DynamicPolicy) putAllocationsAndAdjustAllocationEntries(allocationInfos return p.putAllocationsAndAdjustAllocationEntriesVpaAware(nil, allocationInfos, incrByReq, false) } -func (p *DynamicPolicy) putAllocationsAndAdjustAllocationEntriesVpaAware(originAllocationInfos, allocationInfos []*state.AllocationInfo, incrByReq, podIsInVpaResize bool) error { +func (p *DynamicPolicy) putAllocationsAndAdjustAllocationEntriesVpaAware(originAllocationInfos, allocationInfos []*state.AllocationInfo, incrByReq, podInplaceUpdateResizing bool) error { if len(allocationInfos) == 0 { return nil } - if podIsInVpaResize { + if podInplaceUpdateResizing { if len(originAllocationInfos) != 1 && len(allocationInfos) != 1 { general.Errorf("cannot adjust allocation entries for invalid allocation infos") return fmt.Errorf("invalid vpa allocation infos length") @@ -708,7 +708,7 @@ func (p *DynamicPolicy) putAllocationsAndAdjustAllocationEntriesVpaAware(originA } poolsQuantityMap = machine.ParseCPUAssignmentQuantityMap(csetMap) - if podIsInVpaResize { + if podInplaceUpdateResizing { // adjust pool resize originAllocationInfo := originAllocationInfos[0] allocationInfo := allocationInfos[0] @@ -739,8 +739,8 @@ func (p *DynamicPolicy) putAllocationsAndAdjustAllocationEntriesVpaAware(originA return fmt.Errorf("GetSharedQuantityMapFromPodEntries failed with error: %v", err) } - if incrByReq || podIsInVpaResize { - if podIsInVpaResize { + if incrByReq || podInplaceUpdateResizing { + if podInplaceUpdateResizing { general.Infof("pod: %s/%s, container: %s request to re-calc pool size for cpu VPA resize", allocationInfos[0].PodNamespace, allocationInfos[0].PodName, allocationInfos[0].ContainerName) } @@ -1679,13 +1679,13 @@ func (p *DynamicPolicy) shouldSharedCoresRampUp(podUID string) bool { } } -func (p *DynamicPolicy) doAndCheckPutAllocationInfoPodVPAResizingAware(originAllocationInfo, allocationInfo *state.AllocationInfo, incrByReq, podIsInVPAResizing bool) (*state.AllocationInfo, error) { +func (p *DynamicPolicy) doAndCheckPutAllocationInfoPodResizingAware(originAllocationInfo, allocationInfo *state.AllocationInfo, incrByReq, podInplaceUpdateResizing bool) (*state.AllocationInfo, error) { if allocationInfo == nil { return nil, fmt.Errorf("doAndCheckPutAllocationInfo got nil allocationInfo") } // need to adjust pools and putAllocationsAndAdjustAllocationEntries will set the allocationInfo after adjusted - err := p.putAllocationsAndAdjustAllocationEntriesVpaAware([]*state.AllocationInfo{originAllocationInfo}, []*state.AllocationInfo{allocationInfo}, incrByReq, podIsInVPAResizing) + err := p.putAllocationsAndAdjustAllocationEntriesVpaAware([]*state.AllocationInfo{originAllocationInfo}, []*state.AllocationInfo{allocationInfo}, incrByReq, podInplaceUpdateResizing) if err != nil { general.Errorf("pod: %s/%s, container: %s putAllocationsAndAdjustAllocationEntriesVpaAware failed with error: %v", allocationInfo.PodNamespace, allocationInfo.PodName, allocationInfo.ContainerName, err) @@ -1703,7 +1703,7 @@ func (p *DynamicPolicy) doAndCheckPutAllocationInfoPodVPAResizingAware(originAll } func (p *DynamicPolicy) doAndCheckPutAllocationInfo(allocationInfo *state.AllocationInfo, incrByReq bool) (*state.AllocationInfo, error) { - return p.doAndCheckPutAllocationInfoPodVPAResizingAware(nil, allocationInfo, incrByReq, false) + return p.doAndCheckPutAllocationInfoPodResizingAware(nil, allocationInfo, incrByReq, false) } func (p *DynamicPolicy) getReclaimOverlapShareRatio(entries state.PodEntries) (map[string]float64, error) { diff --git a/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_hint_handlers.go b/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_hint_handlers.go index f147350f00..eadf14ccda 100644 --- a/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_hint_handlers.go +++ b/pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_hint_handlers.go @@ -80,7 +80,7 @@ func (p *DynamicPolicy) sharedCoresHintHandler(ctx context.Context, func (p *DynamicPolicy) reclaimedCoresHintHandler(ctx context.Context, req *pluginapi.ResourceRequest, ) (*pluginapi.ResourceHintsResponse, error) { - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { return nil, fmt.Errorf("not support VPA for reclaimed cores") } return p.sharedCoresHintHandler(ctx, req) @@ -93,7 +93,7 @@ func (p *DynamicPolicy) dedicatedCoresHintHandler(ctx context.Context, return nil, fmt.Errorf("dedicatedCoresHintHandler got nil req") } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { return nil, fmt.Errorf("not support VPA for dedicated cores") } @@ -545,7 +545,7 @@ func (p *DynamicPolicy) sharedCoresWithNUMABindingHintHandler(_ context.Context, hints = cpuutil.RegenerateHints(allocationInfo, reqInt) // regenerateHints failed. need to clear container record and re-calculate. - if hints == nil || util.PodIsInVPAResizing(req) { + if hints == nil || util.PodInplaceUpdateResizing(req) { machineState, err = p.clearContainerAndRegenerateMachineState(podEntries, req) if err != nil { general.Errorf("pod: %s/%s, container: %s clearContainerAndRegenerateMachineState failed with error: %v", @@ -553,14 +553,14 @@ func (p *DynamicPolicy) sharedCoresWithNUMABindingHintHandler(_ context.Context, return nil, fmt.Errorf("GenerateMachineStateFromPodEntries failed with error: %v", err) } } - } else if util.PodIsInVPAResizing(req) { + } else if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s request to cpu VPA resize, but no origin allocation info", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("no origin allocation info") } - general.Infof("pod: %s/%s, container: %s, VPA: %v", req.PodNamespace, req.PodName, req.ContainerName, util.PodIsInVPAResizing(req)) - if util.PodIsInVPAResizing(req) { + general.Infof("pod: %s/%s, container: %s, VPA: %v", req.PodNamespace, req.PodName, req.ContainerName, util.PodInplaceUpdateResizing(req)) + if util.PodInplaceUpdateResizing(req) { numaset := allocationInfo.GetAllocationResultNUMASet() if numaset.Size() != 1 { general.Errorf("pod: %s/%s, container: %s is snb, but its numa set size is %d", diff --git a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy.go b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy.go index 3dd6450ea8..59d01e6093 100644 --- a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy.go +++ b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy.go @@ -886,7 +886,7 @@ func (p *DynamicPolicy) Allocate(ctx context.Context, }() allocationInfo := p.state.GetAllocationInfo(v1.ResourceMemory, req.PodUid, req.ContainerName) - if allocationInfo != nil && allocationInfo.AggregatedQuantity >= uint64(reqInt) && !util.PodIsInVPAResizing(req) { + if allocationInfo != nil && allocationInfo.AggregatedQuantity >= uint64(reqInt) && !util.PodInplaceUpdateResizing(req) { general.InfoS("already allocated and meet requirement", "podNamespace", req.PodNamespace, "podName", req.PodName, @@ -1004,7 +1004,7 @@ func (p *DynamicPolicy) getContainerRequestedMemoryBytes(allocationInfo *state.A // if there is these two annotations in memory state, it is a new pod, // we don't need to check the pod request from podWatcher if allocationInfo.Annotations[apiconsts.PodAnnotationAggregatedRequestsKey] != "" || - allocationInfo.Annotations[apiconsts.PodAnnotationVPAResizingKey] != "" { + allocationInfo.Annotations[apiconsts.PodAnnotationInplaceUpdateResizingKey] != "" { return allocationInfo.AggregatedQuantity } diff --git a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_allocation_handlers.go b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_allocation_handlers.go index fa0d584c42..5738ad606c 100644 --- a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_allocation_handlers.go +++ b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_allocation_handlers.go @@ -56,7 +56,7 @@ func (p *DynamicPolicy) reclaimedCoresAllocationHandler(ctx context.Context, return nil, fmt.Errorf("reclaimedCoresAllocationHandler got nil request") } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s request to memory VPA resize, but not support reclaimed cores", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("not support VPA resize for reclaiemd cores") @@ -76,7 +76,7 @@ func (p *DynamicPolicy) dedicatedCoresAllocationHandler(ctx context.Context, return nil, fmt.Errorf("dedicatedCoresAllocationHandler got nil req") } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s request to memory VPA resize, but not support dedicated cores", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("not support VPA resize for didecated cores") @@ -112,7 +112,7 @@ func (p *DynamicPolicy) numaBindingAllocationHandler(ctx context.Context, allocationInfo := p.state.GetAllocationInfo(v1.ResourceMemory, req.PodUid, req.ContainerName) if allocationInfo != nil { - if allocationInfo.AggregatedQuantity >= uint64(podAggregatedRequest) && !util.PodIsInVPAResizing(req) { + if allocationInfo.AggregatedQuantity >= uint64(podAggregatedRequest) && !util.PodInplaceUpdateResizing(req) { general.InfoS("already allocated and meet requirement", "podNamespace", req.PodNamespace, "podName", req.PodName, @@ -135,7 +135,7 @@ func (p *DynamicPolicy) numaBindingAllocationHandler(ctx context.Context, "memoryReq(bytes)", podAggregatedRequest, "currentResult(bytes)", allocationInfo.AggregatedQuantity) - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { // remove the main container of this pod (the main container involve the whole pod requests) containerEntries := podEntries[req.PodUid] delete(containerEntries, req.ContainerName) @@ -155,7 +155,7 @@ func (p *DynamicPolicy) numaBindingAllocationHandler(ctx context.Context, "currentResult(bytes)", allocationInfo.AggregatedQuantity) return nil, fmt.Errorf("generateMemoryMachineStateByPodEntries failed with error: %v", stateErr) } - } else if util.PodIsInVPAResizing(req) { + } else if util.PodInplaceUpdateResizing(req) { general.Errorf("pod %s/%s, container: %s request to memory VPA, but no origin allocation info", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("no origin allocation info") diff --git a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_hint_handlers.go b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_hint_handlers.go index 59dd9cd1ae..5b97f06e55 100644 --- a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_hint_handlers.go +++ b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_hint_handlers.go @@ -71,7 +71,7 @@ func (p *DynamicPolicy) sharedCoresHintHandler(ctx context.Context, func (p *DynamicPolicy) reclaimedCoresHintHandler(ctx context.Context, req *pluginapi.ResourceRequest, ) (*pluginapi.ResourceHintsResponse, error) { - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s request to memory VPA resize, but not support reclaimed cores", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("not support VPA resize for reclaimed cores") @@ -86,7 +86,7 @@ func (p *DynamicPolicy) dedicatedCoresHintHandler(ctx context.Context, return nil, fmt.Errorf("dedicatedCoresHintHandler got nil req") } - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s request to memory VPA resize, but not support dedicated cores", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("not support VPA resize for didecated cores") @@ -127,10 +127,10 @@ func (p *DynamicPolicy) numaBindingHintHandler(_ context.Context, req.PodNamespace, req.PodName, req.ContainerName, allocationInfo.NumaAllocationResult.Size()) return nil, fmt.Errorf("invalid numa set size") } - hints = regenerateHints(uint64(podAggregatedRequest), allocationInfo, util.PodIsInVPAResizing(req)) + hints = regenerateHints(uint64(podAggregatedRequest), allocationInfo, util.PodInplaceUpdateResizing(req)) // regenerateHints failed, and we need to clear container record and re-calculate. - if hints == nil || util.PodIsInVPAResizing(req) { + if hints == nil || util.PodInplaceUpdateResizing(req) { var err error resourcesMachineState, err = p.clearPodAndRegenerateMachineState(req) if err != nil { @@ -139,7 +139,7 @@ func (p *DynamicPolicy) numaBindingHintHandler(_ context.Context, return nil, fmt.Errorf("GenerateMachineStateFromPodEntries failed with error: %v", err) } } - } else if util.PodIsInVPAResizing(req) { + } else if util.PodInplaceUpdateResizing(req) { general.Errorf("pod: %s/%s, container: %s request to VPA resize, but no origin allocation info", req.PodNamespace, req.PodName, req.ContainerName) return nil, fmt.Errorf("no origin allocation info") @@ -159,7 +159,7 @@ func (p *DynamicPolicy) numaBindingHintHandler(_ context.Context, } // check or regenerate hints for VPA mode - if util.PodIsInVPAResizing(req) { + if util.PodInplaceUpdateResizing(req) { if allocationInfo.NumaAllocationResult.Size() != 1 { general.Errorf("pod: %s/%s, container: %s is snb, but its numa size is %d", req.PodNamespace, req.PodName, req.ContainerName, allocationInfo.NumaAllocationResult.Size()) @@ -356,11 +356,11 @@ func (p *DynamicPolicy) calculateHints(reqInt uint64, resourcesMachineState stat // regenerateHints regenerates hints for container that'd already been allocated memory, // and regenerateHints will assemble hints based on already-existed AllocationInfo, // without any calculation logics at all -func regenerateHints(reqInt uint64, allocationInfo *state.AllocationInfo, podIsInVpaResizing bool) map[string]*pluginapi.ListOfTopologyHints { +func regenerateHints(reqInt uint64, allocationInfo *state.AllocationInfo, podInplaceUpdateResizing bool) map[string]*pluginapi.ListOfTopologyHints { hints := map[string]*pluginapi.ListOfTopologyHints{} allocatedInt := allocationInfo.AggregatedQuantity - if allocatedInt < reqInt && !podIsInVpaResizing { + if allocatedInt < reqInt && !podInplaceUpdateResizing { general.ErrorS(nil, "memory's already allocated with smaller quantity than requested", "podUID", allocationInfo.PodUid, "containerName", allocationInfo.ContainerName, "requestedResource", reqInt, "allocatedSize", allocatedInt) diff --git a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_test.go b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_test.go index 2e705cc5c5..0bf54d0698 100644 --- a/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_test.go +++ b/pkg/agent/qrm-plugins/memory/dynamicpolicy/policy_test.go @@ -3787,7 +3787,7 @@ func TestSNBMemoryAdmitWithSidecarReallocate(t *testing.T) { as.Nil(err) dynamicPolicy.podAnnotationKeptKeys = []string{ consts.PodAnnotationMemoryEnhancementNumaBinding, - consts.PodAnnotationVPAResizingKey, + consts.PodAnnotationInplaceUpdateResizingKey, consts.PodAnnotationAggregatedRequestsKey, } diff --git a/pkg/agent/qrm-plugins/util/util.go b/pkg/agent/qrm-plugins/util/util.go index d89fef228b..d7bd1348e0 100644 --- a/pkg/agent/qrm-plugins/util/util.go +++ b/pkg/agent/qrm-plugins/util/util.go @@ -327,8 +327,8 @@ func GetAsyncWorkNameByPrefix(prefix, topic string) string { return strings.Join([]string{prefix, topic}, asyncworker.WorkNameSeperator) } -func PodIsInVPAResizing(req *pluginapi.ResourceRequest) bool { - return req.Annotations != nil && req.Annotations[apiconsts.PodAnnotationVPAResizingKey] == "true" +func PodInplaceUpdateResizing(req *pluginapi.ResourceRequest) bool { + return req.Annotations != nil && req.Annotations[apiconsts.PodAnnotationInplaceUpdateResizingKey] == "true" } func GetPodAggregatedRequestResource(req *pluginapi.ResourceRequest) (int, float64, error) { diff --git a/pkg/config/agent/qrm/qrm_base.go b/pkg/config/agent/qrm/qrm_base.go index ba17907538..14387bc334 100644 --- a/pkg/config/agent/qrm/qrm_base.go +++ b/pkg/config/agent/qrm/qrm_base.go @@ -41,7 +41,7 @@ func NewGenericQRMPluginConfiguration() *GenericQRMPluginConfiguration { return &GenericQRMPluginConfiguration{ PodAnnotationKeptKeys: []string{ consts.PodAnnotationAggregatedRequestsKey, - consts.PodAnnotationVPAResizingKey, + consts.PodAnnotationInplaceUpdateResizingKey, }, PodLabelKeptKeys: []string{}, }