The following two upstream commits break WRS initialization of kubelet
starting in Kubernetes 1.32, specifically for cpu_manager_policy 'none',
using cgroupfs driver and cgroup v1. This appears to be upstream bug.
kubelet/cm: move CPU reading from cm to cm/cpumanager
77d03e42cd
kubelet/cm: fix bug where kubelet restarts from missing cpuset cgroup
c51195dbd0
In the case of cpu manager policy 'none', there are no allocatable cpus.
Initializing the container manager cpuset using GetAllCPUs() produces a
write violation for k8s-infra/kubepods/cpuset.cpus since the cpuset is
larger than the parent cgroup k8s-infra/cpuset.cpus.
This update initializes 'none' with GetAllocatableCPUs() which is an
empty cpuset. Note that if GetAllCPUs() were to be used, we should also
exclude reserved cpus.
This fix will need to be carried forward until there is upstream fix.
TEST PLAN:
PASS: Manual build of kubernetes for: 1.32.2, 1.33.0, master,
perform standard make tests.
PASS: AIO-SX, Standard: Fresh install K8S 1.32.2, 1.33.0 using with
'none' cpu_manager_policy. i.e., label kube-cpu-mgr-policy=none,
(or, kube-cpu-mgr-policy not specified)
PASS: AIO-SX, Fresh install K8S 1.32.2, label kube-cpu-mgr-policy=static.
PASS: AIO-SX: Orchestrated K8S upgrade from 1.32.2 to 1.33.0 with
'none' cpu_manager_policy.
NOTE: Testing with the following cherry-picked K8S 1.33 reviews.
https://review.opendev.org/c/starlingx/integ/+/951752https://review.opendev.org/c/starlingx/ansible-playbooks/+/951840
Closes-Bug: 2115071
Change-Id: Ifc342977fb6cbe0c768d5a1bf7fe6f0089b80415
Signed-off-by: Jim Gauld <James.Gauld@windriver.com>