c9b781b7c0
The script will run everytime before the kubelet service is started. It reads the reserved-cpus list for the kubelet from the service environment file and sanitizes it on the basis of online CPUs. If none of the reserved cpus is online, it removes the --reserved-cpus flag from the environment file which allows the kubelet to choose CPUs itself. Sanitizing the reserved-cpus list everytime before the kubelet starts assures that the kubelet will not fail to start due to unavailability of one or more CPUs in the list. By enabling or disabling CPU hyperthreading, available CPUs change. This change will make sure changing CPU hyperthreading setting will not lead to kubelet start failure after the system boots up. Test Plan: (On AIO-SX) PASS: Initial Hyperthreading state: enabled Host-lock->Reboot->Disable CPU hyperthreading and reboot->Host-unlock Observe kubelet does not fail to start before host-unlock. All pods states are as expected. Host-unlock succeeds. PASS: Initial Hyperthreading state: disabled Host-lock->Reboot->Enable CPU hyperthreading and reboot->Host-unlock Observe kubelet does not fail to start before host-unlock. All pods states are as expected. Host-unlock succeeds. PASS: Manually restart the Kubelet service. Observe that the kubelet does not fail to start. All pods states are as expected. PASS: Host-lock->Host unlock (without any config change). Observe that the kubelet does not fail to start. All pods states are as expected. PASS: Packages built successfully on both Debian and CentOS. Closes-Bug: 1955608 Change-Id: I699c5c36a56a50d4c48faa816edad69c17058079 Signed-off-by: Kaustubh Dhokte <kaustubh.dhokte@windriver.com>
9 lines
276 B
Plaintext
9 lines
276 B
Plaintext
usr/lib/systemd/system/kubelet.service
|
|
etc/kubernetes/config
|
|
etc/kubernetes/kubelet
|
|
etc/kubernetes/kubelet.kubeconfig
|
|
etc/kubernetes/proxy
|
|
etc/systemd/system.conf.d/kubernetes-accounting.conf
|
|
usr/lib/tmpfiles.d/kubernetes.conf
|
|
usr/local/sbin/sanitize_kubelet_reserved_cpus.sh
|