Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick of #78495: Fix issues in kubelet for Aarch64 resulting in kubelet crashing on starup #79671

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/kubelet/cm/cgroup_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const (

// hugePageSizeList is useful for converting to the hugetlb canonical unit
// which is what is expected when interacting with libcontainer
var hugePageSizeList = []string{"B", "kB", "MB", "GB", "TB", "PB"}
var hugePageSizeList = []string{"B", "KB", "MB", "GB", "TB", "PB"}

var RootCgroupName = CgroupName([]string{})

Expand Down
9 changes: 9 additions & 0 deletions pkg/kubelet/cm/container_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ func validateSystemRequirements(mountUtil mount.Interface) (features, error) {
// Takes the absolute name of the specified containers.
// Empty container name disables use of the specified container.
func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.Interface, nodeConfig NodeConfig, failSwapOn bool, devicePluginEnabled bool, recorder record.EventRecorder) (ContainerManager, error) {
// Mitigation of the issue fixed in master where hugetlb prefix for page sizes with "KiB"
// is "kB" in runc, but the correct is "KB"
// See https://github.com/opencontainers/runc/pull/2065
// and https://github.com/kubernetes/kubernetes/pull/78495
// for more info.
for i, pageSize := range fs.HugePageSizes {
fs.HugePageSizes[i] = strings.ReplaceAll(pageSize, "kB", "KB")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see how this is simpler than the alternative, and runc is making the variable global and writable for better or worse. Since a proper fix was put in master, and there is no other known writer to that var I could find, this is probably reasonable and small.

}

subsystems, err := GetCgroupSubsystems()
if err != nil {
return nil, fmt.Errorf("failed to get mounted cgroup subsystems: %v", err)
Expand Down