Coding Ninja
Coding Ninja

Reputation: 385

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

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

Upvotes: 1

Views: 102

Answers (2)

danaucpe
danaucpe

Reputation: 1

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.

Upvotes: 0

Marcin Romaszewicz
Marcin Romaszewicz

Reputation: 969

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.

Upvotes: 2

Related Questions