Merge pull request #79671 from odinuge/automated-cherry-pick-of-#78495-upstream-release-1.15

Cherry pick of #78495: Fix issues in kubelet for Aarch64 resulting in kubelet crashing on starup
k3s-v1.15.3
Kubernetes Prow Robot 2019-08-08 06:09:19 -07:00 committed by GitHub
commit b3a664eeeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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{})

View File

@ -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")
}
subsystems, err := GetCgroupSubsystems()
if err != nil {
return nil, fmt.Errorf("failed to get mounted cgroup subsystems: %v", err)