[FG:InPlacePodVerticalScaling] Pod CPU limit is not configured to cgroups as calculated #129357
Labels
kind/bug
Categorizes issue or PR as related to a bug.
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.
What happened?
As a result of #124216, which was introduced in v.1.32, a pod CPU limit calculated in
ResourceConfigForPod()
is rounded up to the nearest 10ms inlibcontainer
at resizing the pod:When
systemd
cgroup driver is used,libcontainer
passes the CPU Quota tosystemd
with rounding up:kubernetes/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go
Lines 304 to 311 in a4b8a3b
In addition, there seems to be a race in
libcontainer
. It directly writes values to the cgroup file without roundup after it passes the rounded value tosystemd
:kubernetes/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go
Lines 489 to 493 in a4b8a3b
So, there is also a case where the cgroup value is set as calculated. As far as I tried, decreasing CPU limits usually hits this case though I’m not sure why:
Decrease the CPU limits:
Both the container and the pod cgroup values are set with 1ms precision:
What did you expect to happen?
This tiny gap can be practically ignored. However, we might need to confirm this gap doesn’t cause a similar issue to #128769.
How can we reproduce it (as minimally and precisely as possible)?
systemd
cgroup driver and enableInPlacePodVertialScaling
.Anything else we need to know?
No response
Kubernetes version
V1.32
Cloud provider
N/A
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: