How to: Using kube-state-metrics and Prometheus alerts
When [kube-state-metrics] is deployed in the cluster and a [Prometheus] installation
is scraping the metrics, you can alert on OOM-killed pods using the prometheus alert manager.

Example alert:

    alert: ComponentOutOfMemory
    expr: sum_over_time(kube_pod_container_status_terminated_reason{reason="OOMKilled"}[5m])
      > 0
    for: 10s
    labels:
      severity: warning
    annotations:
      description: Critical Pod {{$labels.namespace}}/{{$labels.pod}} was OOMKilled.

The downside is that `kube_pod_container_status_terminated_reason` always returns to 0 once
a container starts back up. See the introduction of
[`kube_pod_container_status_last_terminated_reason`] for more details.