In any well-functioning environment, whether it's an army unit or a Kubernetes cluster, resources have to be allocated wisely. You want an army unit that is well equipped, well organised and performing at its peak. The same goes for your applications in Kubernetes: some resources should be shared flexibly, while others have to be managed strictly to prevent instability.

Two important resources in Kubernetes are CPU and memory, but they work in completely different ways. CPU is a compressible resource—it can be shared flexibly, so imposing strict limits often leads to inefficiencies. Memory, on the other hand, is not compressible—once allocated, it has to be managed properly to prevent crashes. Let’s look at how these principles work by taking a well-run army unit as an example and linking it to Kubernetes resource management.
CPU Limits: Why Restricting a Compressible Resource Is a Bad Idea
CPU is like sleep in an army unit—everyone needs it, but not in exactly the same amount or at exactly the same time. If a soldier needs more sleep after an exhausting mission, they should be able to get it, as long as another soldier who needs less gets up earlier. Fixed sleep schedules undermine the performance of the whole unit.
Analogy: Soldiers and Sleep
Imagine an army unit with a strict rule: every soldier gets exactly six hours of sleep, no more, no less.
- A soldier who was on night watch needs eight hours, but has to get up and stays tired.
- Another soldier had a quiet day and only needs four hours, but still has to stay in bed for six hours to no purpose.
- The result? Some soldiers are running on empty, while others are wasting time.
This is exactly what happens when CPU limits are imposed in Kubernetes. If a pod temporarily needs more CPU but is limited, it gets throttled, even when there is unused CPU left. Instead of rigid limits, it’s better to share CPU flexibly, so the system runs as efficiently as possible.
Other Examples of CPU Allocation:
- Public Wi-Fi in a café – Every customer gets exactly 1 Mbps of bandwidth. Someone just browsing barely uses anything, while someone on a video call keeps freezing. Meanwhile, unused bandwidth goes to waste.
- Lanes on a motorway – If every car is stuck in an assigned lane, some lanes stay empty while others are packed.
- Borrowing books from a library – Everyone may borrow exactly two books. Some take books they don’t really need, while others can’t take home books that would be useful.
Key insight: CPU should be shared dynamically based on demand. Strict CPU limits reduce efficiency and cause unnecessary slowdowns.
Memory Limits: Why Restricting a Non-Compressible Resource Is Essential
Memory, unlike CPU, is not compressible. When a process uses memory, it stays taken until it is explicitly released. If a pod uses too much memory, it can cause other workloads to crash. That’s why memory has to be managed strictly with limits, just like storage space in an army unit.
Analogy: Soldiers and Storage Lockers
Every soldier in an army unit has a personal storage locker for essentials—ammunition, equipment and personal belongings.
- Some soldiers pack efficiently and have room to spare.
- Others try to store too much and put their extra gear in someone else’s locker.
- When that soldier needs their own space, they throw the extra gear out, possibly something important.
This is exactly what happens when memory limits aren’t set in Kubernetes. If a pod uses too much memory, the system may have to force processes to stop or kill pods, which can lead to data loss or crashes. By setting memory limits, we prevent one pod from eating up all the resources and putting other workloads at risk.
Other Examples of Memory Management:
- Storage space in a warehouse – If one company stores too much stock, others have to throw goods away to make room.
- Hand luggage on a plane – If one passenger fills the overhead bins with too much luggage, others have to check in their bags.
- A shared fridge – If one person fills the whole fridge, others have to throw food away to make room.
Key insight: Memory should be strictly limited to prevent a single workload from destabilising the whole system.
The Perfectly Run Army Unit = An Optimised Kubernetes Cluster
Just as an army unit functions optimally when:
✅ Soldiers get the sleep they need (CPU is shared dynamically)
✅ Storage space is managed properly (Memory is allocated and limited properly)
A Kubernetes cluster runs optimally when:
✅ CPU is flexibly available to workloads that need it, without artificial limits
✅ Memory is managed carefully, so no single workload claims everything and destabilises others
Conclusion
When configuring Kubernetes resources, it’s important to remember:
🚫 Avoid CPU limits where possible - they cause inefficiencies and unnecessary throttling.
✅ Set memory limits - they prevent crashes and ensure a fair distribution of resources.
By treating CPU and memory the right way, you create an efficient, stable and powerful Kubernetes cluster—just like an elite unit operating at full capacity.
💡What do you think? Have you run into problems with CPU or memory limits in Kubernetes? Let us know!

