Kubernetes, requests & limits
Darshana Kasthuriarachchi
Kubernetes & Docker | Expert in Container Orchestration and Cloud Solutions | Driving Efficiency & Scalability | Cloud Subject Matter Expert | Azure platform | Oracle Certified | 2X Red Hat | ITIL | MBA
In Kubernetes, requests and limits are configurations used to manage the CPU and memory resources allocated to containers within a pod.
#Requests
The amount of CPU and memory that Kubernetes guarantees to a container.
If a container requests a certain amount of resources, Kubernetes ensures that those resources are available to it.
If a pod specifies a CPU request of 500m (which means 0.5 CPU cores) and a memory request of 256Mi, it will be scheduled on a node that has at least these resources available.
#Limits
The maximum amount of CPU and memory that a container can use.
If the container exceeds these limits, it may be throttled or terminated (in the case of memory).
If a pod sets a CPU limit of 1 (1 CPU core) and a memory limit of 512Mi, it can use up to that amount, but not exceed it.