Allow in-place pod resize to clear pod limits#138187
Conversation
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi @abishekgiri. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: abishekgiri The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This fixes kubelet's in-place pod resize path so pod-level CPU and memory limits can actually be removed. What changed:
Result:
Verification:
|
/kind bug
Summary
In-place pod resize could add or change pod-level CPU and memory limits, but it could not remove them.
If the desired pod-level limit was unset, kubelet fell back to the current cgroup value, so the old limit stayed in place. The actuated pod-level resource state could also keep the old limit when the updated pod spec no longer had that key.
This keeps a real "clear the limit" path through pod resize, uses the expected no-limit form when talking to cgroups and CRI, and updates the actuated pod-level state when a limit is removed.
Testing
go test ./pkg/kubelet/kuberuntime -run 'TestConvertResourceConfigToLinuxContainerResources|TestDoPodResizeAction|TestValidatePodResizeAction'GOOS=linux GOARCH=amd64 go test -c -o /tmp/kuberuntime-linux.test ./pkg/kubelet/kuberuntime