Skip to content

Commit

Permalink
Remove cpu_manager_state in initramfs stage
Browse files Browse the repository at this point in the history
Signed-off-by: Cooper Tseng <[email protected]>
  • Loading branch information
brandboat committed Aug 14, 2024
1 parent b70f9a6 commit d620ffc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/config/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func ConvertToCOS(config *HarvesterConfig) (*yipSchema.YipConfig, error) {
for _, module := range cfg.OS.Modules {
initramfs.Commands = append(initramfs.Commands, "modprobe "+module)
}
// Delete the cpu_manager_state file during the initramfs stage. During a reboot, this state file is always reverted
// because it was originally created during the system installation, becoming part of the root filesystem.
// As a result, the policy in cpu_manager_state file is "none" after reboot. If we've already set the cpu-manager-policy to
// "static" before reboot, this mismatch can prevent kubelet from starting, and make the entire node unavailable.
initramfs.Commands = append(initramfs.Commands, "rm -f /var/lib/kubelet/cpu_manager_state")

initramfs.Sysctl = cfg.OS.Sysctls
initramfs.Environment = cfg.OS.Environment
Expand Down

0 comments on commit d620ffc

Please sign in to comment.