Sobes.tech
Junior — Middle

What is the difference between Limits and Requests settings in Kubernetes and what are they for?

sobes.tech AI

Answer from AI

In Kubernetes, Requests and Limits are used to manage container resources:

  • Requests — this is the minimum amount of resources (CPU, memory) that the container is guaranteed to receive. The Kubernetes scheduler uses these values to determine on which node to place the pod. If a node cannot provide the requested resources, the pod will not be scheduled on that node.

  • Limits — this is the maximum amount of resources that the container can use. If the container exceeds the CPU limit, its usage will be throttled. If it exceeds the memory limit, the container may be killed (OOMKilled).

Thus, Requests guarantee minimum resources for stable operation, while Limits prevent excessive resource consumption, helping to avoid conflicts and overloads in the cluster.