Kubernetes - Does the cpu limit specified locks the resource in the Node

8/14/2018

Given a Node with 10 cpu, if I request a Pod with request 4cpu and limit 6cpu, does that mean the Node has only 4cpu for usage left?

real question here is if I need a Pod with 2 cpu request and 5 cpu limit, as the Node doesn't have 5 cpu left the pod won't be provisioned?

its not clear in the docs

-- Coding Ninja
google-kubernetes-engine
kubectl
kubernetes

2 Answers

8/17/2018

Request are considered during scheduling. Limits are considered while running. Be sure to consider resources reserved for kubernetes as these will not be available to your pods.

-- danaucpe
Source: StackOverflow

8/14/2018

The requests are used for scheduling, the limits are that, limits. So, in your example, the node will still have 6 CPU remaining after scheduling your 4 CPU request. It will let your pod use up to 6 CPU, but it will start to limit its performance if it tries to use more than 6, so that it never exceeds 6.

The 2 CPU request with 5 CPU limit can be scheduled on a 2 CPU node, providing that nothing else is running there which requested any CPU.

-- Marcin Romaszewicz
Source: StackOverflow