kubernetesk8s.io/kubernetes/pkg/kubelet/qos Index | Files

package qos

import "k8s.io/kubernetes/pkg/kubelet/qos"

Package qos contains helper functions for quality of service. For each resource (memory, CPU) Kubelet supports three classes of containers. Memory guaranteed containers will receive the highest priority and will get all the resources they need. Burstable containers will be guaranteed their request and can "burst" and use more resources when available. Best-Effort containers, which don't specify a request, can use resources only if not being used by other pods.

Index

Constants

const (
	// KubeletOOMScoreAdj is the OOM score adjustment for Kubelet
	KubeletOOMScoreAdj int = -999
	// KubeProxyOOMScoreAdj is the OOM score adjustment for kube-proxy
	KubeProxyOOMScoreAdj int = -999
)

Functions

func GetContainerOOMScoreAdjust

func GetContainerOOMScoreAdjust(pod *v1.Pod, container *v1.Container, memoryCapacity int64) int

GetContainerOOMScoreAdjust returns the amount by which the OOM score of all processes in the container should be adjusted. The OOM score of a process is the percentage of memory it consumes multiplied by 10 (barring exceptional cases) + a configurable quantity which is between -1000 and 1000. Containers with higher OOM scores are killed if the system runs out of memory. See https://lwn.net/Articles/391222/ for more information. OOMScoreAdjust should be calculated based on the allocated resources, so the pod argument should contain the allocated resources in the spec.

Source Files

doc.go helpers.go policy.go

Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
3 hours ago

Tools for package owners.