Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

default container CPU limits in Kubernetes?

Tags:

kubernetes

From here i realized, if container is not given CPU limits, then it takes up default CPU limits from Namespace level: https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/

My question is, what if we have not set default CPU limits (LimitRange) in Namespace level. In this case what CPU limits does Container is assigned ?

Thanks.

like image 729
Molay Avatar asked Oct 24 '25 02:10

Molay


1 Answers

If a container doesn't specify its own CPU request and limit, it is assigned the default CPU request and limit from the LimitRange, if such LimitRange is configured for the namespace.

If LimitRange isn't configured for the namespace and container doesn't specify its own CPU request and limit, the pod runs in the BestEffort QoS (Quality of Service) class. In this case, the CPU is given from a shared pool for the node, up to the available CPU in the shared pool and if there is CPU available in it. In practice, there may not be any CPU available and the pod/container could "starve" for CPU.

like image 170
apisim Avatar answered Oct 26 '25 19:10

apisim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!