Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

Kubernetes OOMKilled Pod Termination Storm Sentinel

Audits Kubernetes core events to detect cluster-wide OOMKilled container termination storms and memory thrashing.

Categories
CloudInfrastructure

How it works

This workflow executes kubectl get events --field-selector reason=OOMKilled -o json to detect memory ceiling terminations within the target namespace. When container memory consumption exceeds configured resources.limits.memory, the Linux kernel cgroup killer abruptly terminates the offending process with exit code 137. If an OOM storm crosses the threshold, an immediate incident alert is dispatched to Slack.

What you get

  • Immediate detection of cascading container OOMKilled crash loops.
  • Prevents silent microservice outages and service disruption.
  • Clear visibility into impacted workloads and termination frequency.

Who it's for

  • SREs and Kubernetes Platform Engineers ensuring workload stability.
  • DevOps engineers setting container resource quotas and memory limits.

Why orchestrate this with Kestra

  • Targeted Event Filtering: Uses official Kubernetes API field selectors directly.
  • Proactive Incident Escalation: Catches memory spikes before entire worker nodes experience memory pressure.
  • Zero Agent Daemon: Executes via lightweight standard kubectl container image.

Prerequisites

  • Kubernetes cluster with read access to Events API in the target namespace.
  • Secret SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import the blueprint.
  2. Configure namespace and event threshold.
  3. Run the workflow to inspect container memory terminations.

How to extend

  • Automatically trigger Vertical Pod Autoscaler (VPA) limit recommendations for failing pods.
  • Export OOM event history to Grafana or Loki for longitudinal analysis.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.