Fractal Techware

Alert runbooks /

KubeContainerOOMKilled

Container was OOM killed. Free rule (MIT): the complete runbook and rule definition are below.

   
Severity warning
Pending (for:) 0m (warning)
keep_firing_for: 10m
Domain Kubernetes workloads
Requires kube-state-metrics v2.x
Rule file rules/kubernetes-workloads.rules.yml (group ftw.kubernetes-workloads.alerts)

Meaning

The container restarted within the last 10 minutes and its last termination reason is OOMKilled - the kernel killed it for exceeding its cgroup memory limit. keep_firing_for keeps the alert up for 10 minutes so a single kill is not lost between notifications.

Impact

In-flight requests on that replica failed and in-memory state was lost. Repeated kills lead to CrashLoopBackOff.

Diagnosis

Mitigation

Escalation

Route to the team that owns the namespace. Platform on-call only takes over when several namespaces are affected at once (likely a node, network or control-plane problem).

Rule definition

From rules/kubernetes-workloads.rules.yml in the free repository (MIT). Unit tests for it are in tests/.

- alert: KubeContainerOOMKilled
  expr: |-
    (increase(kube_pod_container_status_restarts_total{job="kube-state-metrics", namespace=~".+"}[10m]) >= 1)
    and on (cluster, namespace, pod, container)
    (kube_pod_container_status_last_terminated_reason{job="kube-state-metrics", reason="OOMKilled"} == 1)
  keep_firing_for: 10m
  labels:
    severity: warning
  annotations:
    summary: Container was OOM killed.
    description: Container {{ $labels.container }} in pod {{ $labels.namespace }}/{{ $labels.pod }} restarted after being killed for exceeding its memory limit.
    runbook_url: runbooks/kubernetes-workloads/KubeContainerOOMKilled.md