Skip to content

Kubernetes auto-remediation: what it is and how to do it safely

Short answer: Kubernetes auto-remediation is detecting a cluster problem and applying the corrective action automatically — restarting, rolling back, right-sizing, or patching a workload — instead of waiting for a human to read an alert and run kubectl. Done safely it's not "let a bot do anything": it's a closed loop of detect → diagnose → guard-railed fix → verify, with a human approval gate for anything risky.

Last reviewed: 2026-06-27.

The loop

  1. Detect — watch the Kubernetes API in real time for crashes, OOM kills, failed pulls, unbound PVCs, NotReady nodes, stalled rollouts. (No Prometheus required for status-level failures.)
  2. Diagnose — gather logs, events, and prior-container state and identify the root cause, not just the symptom. An LLM is good at this last-mile correlation.
  3. Decide — map the cause to a concrete fix (set resources, rollout undo, set image, restart) and check it against guardrails.
  4. Apply — execute the fix, ideally dry-run previewed and signed/approved.
  5. Verify — confirm the workload actually recovered; if not, re-investigate.
  6. Learn — record the apply/skip decision so future suggestions improve.

Guardrails that make it safe

Auto-remediation earns trust only with hard limits:

Guardrail Why
Read-only by default nothing changes without an explicit, approved action
Allow/deny command list block delete, exec, secret reads, namespace deletes
Protected namespaces never touch kube-system and friends
Dry-run preview show the exact change before it runs
Signed/approved apply only authorized users can click Apply
Blast-radius checks refuse fixes that touch too much at once
Full audit trail every action logged for review

What it is not

  • Not auto-scaling (HPA/VPA/Cluster Autoscaler handle capacity, not failures).
  • Not self-healing controllers alone — Kubernetes restarts a crashed pod, but it won't tell you why it crashed or fix the bad limit/image that caused it.
  • Not unattended kubectl delete — safe remediation is narrow, reversible, and approval-gated.

How Karakuri implements it

Karakuri is an open-source (Apache-2.0) implementation of this exact loop: native watchers detect failures, an LLM diagnoses the root cause, and it posts a one-click guarded fix to Slack — dry-run previewed, signed, audited, then verified after rollout, and re-investigated if it didn't recover. It runs read-only by default and works with OpenAI, Anthropic, Bedrock, Azure, Vertex/Gemini, any OpenAI-compatible endpoint, or a local model. Try it with no Slack and no API key: make demo.

FAQ

Is auto-remediation safe in production? Yes, when it's guard-railed and approval-gated. The risk isn't automation — it's unbounded automation. Keep fixes narrow, reversible, audited, and human-approved for anything destructive.

Does it replace on-call engineers? No — it removes the toil of the common, well-understood failures (crashes, OOM, bad images) so engineers focus on the novel ones. A human still approves risky changes.

Do I need Prometheus for auto-remediation? Not for status-level failures (crashes, OOM, pull errors, NotReady) — those come straight from the Kubernetes API. Metric-based conditions (latency, error-rate) still need Prometheus.