What if one app could silently crash all your others just by using too much memory?
Why Memory requests and limits in Kubernetes? - Purpose & Use Cases
Imagine running many apps on a shared computer without telling it how much memory each app needs. Sometimes one app uses too much memory, making others slow or crash.
Manually guessing memory needs is slow and risky. If you give too little memory, apps crash. Too much memory wastes resources. Without limits, one app can hog all memory, breaking others.
Memory requests and limits let you tell Kubernetes exactly how much memory each app needs and the max it can use. This keeps apps stable and the system balanced automatically.
Run app without memory settings kubectl run myapp --image=myimage
Set memory request and limit kubectl run myapp --image=myimage --requests='memory=200Mi' --limits='memory=500Mi'
This lets Kubernetes manage resources smartly, keeping apps healthy and the system running smoothly even with many apps.
A company runs many microservices on the same cluster. Setting memory requests and limits prevents one service from crashing others during traffic spikes.
Manual memory management causes crashes and slowdowns.
Memory requests reserve needed memory; limits cap max usage.
Using them keeps apps stable and resources balanced automatically.