We run multi-tenant clusters where teams share worker nodes. How do Kubernetes memory limits protect neighboring pods from eviction when one team deploys a poorly optimized application? We want to enforce strict isolation to maintain our internal service level agreements.
3 answers
Without memory limits, an application with a progressive memory leak will continuously consume the worker node's available RAM. Once the node's free memory drops below the hardEvictionThreshold, the kubelet steps in to save the machine. It begins evicting pods based on their Quality of Service class, targeting BestEffort pods first. By enforcing memory limits, the offending pod is killed by the runtime before it can deplete the node's total memory, effectively insulating adjacent tenants from being evicted.
Are you using ResourceQuotas at the namespace level alongside your individual pod limits to manage your multi-tenant environment effectively?
Limits keep resource hogs contained. If a container acts up, it dies alone instead of dragging down the entire node and triggering mass evictions across your teams.
Well summarized. Isolation is the foundation of multi-tenancy. Setting clear ceilings guarantees that neighboring services remain completely unaffected by external code failures.
We recently combined LimitRanges with ResourceQuotas. This ensures that no single team can over-provision their deployments, keeping our entire cluster balanced and safe from runaway resource consumption.