Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the difference between a resource limit and a resource max in Limit Range? And request vs min?

Tags:

kubernetes

LimitRange allows us to configure these properties per resource (memory, CPU):

  • Limit: default maximum ammount of the resource that will be provisioned.
  • Request: default initial ammount of the resource that will be provisioned.

However I just realized there are two other options, min and max. Since min/max seem to overlap with request/limit, what the difference between all these properties?

like image 569
codependent Avatar asked Jul 27 '18 12:07

codependent


People also ask

What is the difference between resource limit and request?

Requests and LimitsRequests are what the container is guaranteed to get. If a container requests a resource, Kubernetes will only schedule it on a node that can give it that resource. Limits, on the other hand, make sure a container never goes above a certain value.

What are resource limits?

Resource limit means the maximum combined value of all resources an individual can have an ownership interest in and still qualify for medicaid.

What happens if you specify a container's limit but not its request?

What if you specify a container's limit, but not its request? The output shows that the container's memory request is set to match its memory limit.

What is limit range in Kubernetes?

By default, containers run with unbounded compute resources on a Kubernetes cluster. Using Kubernetes resource quotas, administrators (also termed cluster operators) can restrict consumption and creation of cluster resources (such as CPU time, memory, and persistent storage) within a specified namespace.


1 Answers

I found the answer digging in the docs. Limit and Request params are overridable by the pod configurations. Min and Max enforce the values configured in the LimitRange:

Motivation for minimum and maximum memory constraints

As a cluster administrator, you might want to impose restrictions on the amount of memory that Pods can use. For example:

Each Node in a cluster has 2 GB of memory. You do not want to accept any Pod that requests more than 2 GB of memory, because no Node in the cluster can support the request.

A cluster is shared by your production and development departments. You want to allow production workloads to consume up to 8 GB of memory, but you want development workloads to be limited to 512 MB. You create separate namespaces for production and development, and you apply memory constraints to each namespace.

like image 183
codependent Avatar answered Oct 23 '22 05:10

codependent