removeMissingExtendedResources() did not remove unknown extension resources from InitContainer #124255
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
sig/node
Categorizes an issue or PR as relevant to SIG Node.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Projects
What happened?
The function removeMissingExtendedResources() located at pkg/kubelet/lifecycle/predicate.go:217, is designed to remove any extended resources from a container’s requests that are not found in nodeInfo.Allocatable before the pod is admitted. This is necessary to support cluster-level resources, which are extended resources that are unknown to nodes.
However, this function only removes missingExtendedResources from the container’s requests, and does not process the requests of initContainers. This could lead to issues, as initContainers might request resources that do not exist on the node, which could result in the pod failing to be admitted or other unforeseen issues. As such, it may be necessary to refine the removeMissingExtendedResources() function to also handle initContainer’s requests.
What did you expect to happen?
Refine the removeMissingExtendedResources() function to also handle initContainer’s requests.
How can we reproduce it (as minimally and precisely as possible)?
Create a pod that requests cluster-level extended resources in both the container and InitContainer.
Anything else we need to know?
No response
Kubernetes version
The problem persists in the latest version.
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: