API server rejects in-place Pod resize requests that exceed node allocatable resources
This is a Bug Report
Problem:
The documentation currently gives "requesting more resources than the node has" as an example of a PodResizePending condition with reason: Infeasible:
- `type: PodResizePending`: The kubelet cannot immediately grant the request. The `message` field provides an explanation of why.
- `reason: Infeasible`: The requested resize is impossible on the current node (for example, requesting more resources than the node has).
Since 1.36 (https://github.com/kubernetes/kubernetes/pull/136043), if a Pod's total CPU or memory requests exceed the node's allocatable resources, the API server rejects the resize request with a Forbidden error instead of accepting it and later reporting the failure through Pod status conditions.
Proposed Solution:
- Update the troubleshooting example to show the
Forbiddenerror returned by the API server. - Clarify that resize requests exceeding the node's allocatable resources are rejected by API server.
- Replace the
Infeasibleexample with another valid example. - Introduce the 'PodResizeValidator' in admission controllers page.
Page to Update:
- https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/
- https://kubernetes.io/docs/concepts/workloads/pods/pod-condition/
- https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/
/sig node /language en
cc @natasha41575
This issue is currently awaiting triage.
SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.
The triage/accepted label can be added by org members by writing /triage accepted in a comment.
Instructions 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.
I can confirm the issue
Since v1.36 (kubernetes/kubernetes#136043), the PodResizeValidator admission plugin rejects a resize when the pod requests exceed the node allocatable. The API server returns Forbidden with cause NodeCapacity. The kubelet check for node allocatable was removed in the same PR. So the kubelet no longer reports this case as PodResizePending / Infeasible.
The new behavior is covered by tests:
- e2e: test/e2e/node/pod_resize.go - a resize that exceeds the node capacity must fail with
Forbiddenand causeNodeCapacity. - integration: TestPodResizeValidation - case "fail resize exceeding node allocatable" expects the error
node didn't have enough allocatable resources: cpuand causeNodeCapacity.
/assign
Hi @Rohit-ATS , thanks for your interest! I’ve already created a PR https://github.com/kubernetes/website/pull/59334 to fix this issue. Since the fix is already covered by that PR, I’d like to remove the current assignment to avoid any duplicate work. I’d really appreciate it if you could review the PR.
/unassign @Rohit-ATS /assign @Chunxia202410