Cases2 cases
1 to 2 of 2
IL-0044Prometheus OOMKilled in a loop while replaying its write-ahead log after a kube-prometheus-stack upgradeSaifeddine Rajhi2024- Symptoms
After an upgrade of the kube-prometheus-stack Helm chart, several pods stayed not ready. Among them was prometheus-prometheus-operator-prometheus-0, showing 3/4 Running and a recent termination.
- Trigger
During the kube-prometheus-stack Helm chart upgrade, Prometheus had to replay its write-ahead log on startup, and the replay needed more memory than its limit allowed.
- Root cause
- Component
- Contributing factor
- Detection
The team noticed pods not ready after the Helm chart upgrade and found the OOMKilled termination with kubectl describe pod.
- Remediation
- ran promtool tsdb analyze inside the Prometheus pod to find high-cardinality metrics such as haproxy_server_http_responses_total
- Action items
- Verify that the memory overhead during WAL replay stays within acceptable limits, for example 10 to 15%, and do not run Prometheus close to its memory limit
- Optimise storage, scraping and remote write configuration and upgrade to newer Prometheus releases
- Recover automatically from OOM crash loops, for example by deleting the WAL on OOM events
- Enforce scrape limits so Prometheus stops scraping targets when memory use passes a threshold
- Lessons
Size Prometheus for its restart, not only for steady state: WAL replay can need far more memory than normal running, and a Prometheus that already runs near its limit can be OOM-killed during the replay. Much of Prometheus memory use comes from cardinality, which promtool tsdb analyze can measure even when Prometheus itself is down.
IL-0070Critical pods on core nodes evicted when Prometheus began scraping about 200 nodes after a dask-gateway scale-up2i2c2023- Symptoms
The hub pod of the prod JupyterHub on the leap cluster (leap.2i2c.org) restarted unexpectedly during a large node scale-up, and a user opened a support ticket. The ingress-nginx and proxy pods kept running.
- Trigger
A user's dask-gateway workload added about 100 dask-worker nodes within a minute, and Prometheus started scraping the metrics exporters on about 200 nodes.
- Root cause
- Component
- Contributing factor
- Detection
A user support ticket (2i2c Freshdesk ticket 414) about the leap hub; the engineer then looked at Grafana and the cluster's nodes and events.
- Action items
- Configure CPU and memory requests for the hub and proxy pods (#2127; at least 100m CPU was proposed)
- Make the Grafana OOMKiller dashboard work (#2213)
- Move LEAP cloud infrastructure to shared nodes (#2209)
- Update resource requests and limits, mainly for ingress-nginx and Prometheus (#2324)
- Decide whether Prometheus should scrape dask worker pods (#2366)
- Lessons
Prometheus load grows with the number of nodes, so a burst of autoscaled nodes can push a nearly full core node over the edge and evict the pods that matter most. Core pods that request 10m of CPU get a tenth of the CPU share of busy neighbours that request 100m. Kubernetes events expire after an hour, so evidence of OOM kills needs a dashboard that keeps it.
These 2 cases involve Prometheus and Container memory limit. kubegap audits a Kubernetes cluster for gaps like these, read-only, from Claude Code or Codex; its checks cite public reports like the ones in this library.
By root cause1
Capacity exhaustion2 cases
- Contributing factor
- Organisation