default container CPU limits in Kubernetes?

10/30/2019

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.

-- Molay
kubernetes

3 Answers

10/30/2019

The container[s] will use the CPU resources of the node/host systems. You have to vertically scale the resources of your nodes if needed.

-- Subramanian Manickam
Source: StackOverflow

10/30/2019

it will just take the resources as required, you can use grafana dashboards in your kubernetes cluster to check the memory and cpu occupancy by the pod. This will give you fair idea about it,

If the node goes out of resources the POD shall acquire status OOM killed

You can download grafana using this helm chart

-- Tushar Mahajan
Source: StackOverflow

10/30/2019

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.

-- apisim
Source: StackOverflow