const MinShares … const MaxShares … const SharesPerCPU … const MilliCPUToCPU … const QuotaPeriod … const MinQuotaPeriod … // MilliCPUToQuota converts milliCPU to CFS quota and period values. // Input parameters and resulting value is number of microseconds. func MilliCPUToQuota(milliCPU int64, period int64) (quota int64) { … } // MilliCPUToShares converts the milliCPU to CFS shares. func MilliCPUToShares(milliCPU int64) uint64 { … } // HugePageLimits converts the API representation to a map // from huge page size (in bytes) to huge page limit (in bytes). func HugePageLimits(resourceList v1.ResourceList) map[int64]int64 { … } // ResourceConfigForPod takes the input pod and outputs the cgroup resource config. func ResourceConfigForPod(pod *v1.Pod, enforceCPULimits bool, cpuPeriod uint64, enforceMemoryQoS bool) *ResourceConfig { … } // getCgroupSubsystemsV1 returns information about the mounted cgroup v1 subsystems func getCgroupSubsystemsV1() (*CgroupSubsystems, error) { … } // getCgroupSubsystemsV2 returns information about the enabled cgroup v2 subsystems func getCgroupSubsystemsV2() (*CgroupSubsystems, error) { … } // GetCgroupSubsystems returns information about the mounted cgroup subsystems func GetCgroupSubsystems() (*CgroupSubsystems, error) { … } // getCgroupProcs takes a cgroup directory name as an argument // reads through the cgroup's procs file and returns a list of tgid's. // It returns an empty list if a procs file doesn't exists func getCgroupProcs(dir string) ([]int, error) { … } // GetPodCgroupNameSuffix returns the last element of the pod CgroupName identifier func GetPodCgroupNameSuffix(podUID types.UID) string { … } // NodeAllocatableRoot returns the literal cgroup path for the node allocatable cgroup func NodeAllocatableRoot(cgroupRoot string, cgroupsPerQOS bool, cgroupDriver string) string { … } // GetKubeletContainer returns the cgroup the kubelet will use func GetKubeletContainer(kubeletCgroups string) (string, error) { … }