Back to guidesGuide

Fix Kubernetes memory alerts without falling for the page cache trap

A practical Prometheus workflow so memory pages fire on RSS, OOMs, and real pressure, not because container_memory_usage_bytes wanted attention.

Learn how to redesign Kubernetes memory saturation alerts by comparing usage, working set, RSS, cache, limits, OOMKilled events, and promtool validation.

Created: August 26, 2026

Published: August 26, 2026

Estimated time40 min
LevelIntermediate
Before you startPrometheus scraping kubelet/cAdvisor and kube-state-metrics
PlatformsLinux / Docker
WhatsAppXLinkedIn

Linux

Diagnose from a Linux workstation with kubectl, the Prometheus API, and promtool.

kubectlcurlpromtool
Compare memory as Kubernetes sees it
kubectl top pod -n shop
Inspect OOM events
kubectl describe pod -n shop checkout-api-7d9f | egrep -i 'oom|killed|memory|restart'
Query working set
curl -G 'http://localhost:9090/api/v1/query' --data-urlencode 'query=sum by (pod,container)(container_memory_working_set_bytes{namespace="shop",container!=""})'
Test rules
promtool test rules tests/k8s-memory-alerts.test.yaml

Content locked

This guide requires both steps before full content is available.

  • Click “Like” on this guide.
  • Share on WhatsApp, X, LinkedIn, or copy the link.

Access is automatically unlocked as soon as both steps are completed.