Search⌘ K
AI Features

Comparing Actual Resource Usage with Defined Limits

Explore how to monitor and compare actual resource usage against defined limits in Kubernetes. Understand the impact of discrepancies on pod distribution, learn to detect when resource limits are reached, and implement alerts using Prometheus to maintain cluster stability and performance.

Discrepancy between requested and actual resource #

Knowing when a container uses too much or too few resources compared to requests helps us be more precise with resource definitions and, ultimately, help Kubernetes make better decisions where to schedule our Pods. In most cases, having too big of a discrepancy between requested and actual resource usage will not result in malfunctioning. Instead, it is more likely to result in an unbalanced distribution of Pods or in having more nodes than we need. Limits, on the other hand, are a different story.

Resource usage reaching the specified limits #

If resource usage of our containers enveloped as Pods reaches the specified limits, Kubernetes might kill those containers if there’s not enough memory for all. It does that as a way to protect the integrity of the rest of the system. Killed Pods are not a ...