requests
What is requests?
requests: The amount of CPU/memory a container is guaranteed. The scheduler uses requests to decide which node a Pod fits on. Requests set how much CPU and memory a container is guaranteed in Kubernetes. The scheduler uses them to decide which node has room for a pod; a pod is only placed where its requests fit.
Frequently asked questions about requests
How is requests used in practice?
If requests are too low, the scheduler packs too many pods onto one node, and they compete for resources under load. If they are too high, nodes look full while sitting mostly idle, and you pay for unused capacity.
What should you keep in mind with requests?
Base requests on real usage. Look at what your containers actually use with kubectl top pods or your monitoring, and set requests a little above normal usage. Revisit them after big changes. Without requests, pods get the BestEffort class and are the first to be evicted when a node runs short of memory.
What does an example of requests look like?
resources: requests: cpu: "250m" memory: "256Mi" At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |