k8s-pod-crashloop

k8s-pod-crashloop is a skill for Claude Code, Codex from kudig-io/kudig-database. It costs 0 tokens per session (4,393 once invoked), scanned A, original, Apache-2.0.

A troubleshooting guide for Kubernetes pods that repeatedly restart or run out of memory. Kubernetes is a system for running and managing containers, and a pod is its basic unit for running an application.

In plain words
What is it for?
Use it to investigate CrashLoopBackOff and OOMKilled failures in Kubernetes workloads.
Why use it?
It helps turn common pod failure symptoms into a diagnosis, a fix, and a check that the fix worked.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to investigate CrashLoopBackOff and OOMKilled failures in Kubernetes workloads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kudig-io/kudig-database/k8s-pod-crashloop
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kudig-io/kudig-database --skill k8s-pod-crashloop
Clone the repo
git clone --depth 1 https://github.com/kudig-io/kudig-database

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-pod-crashloop

README.md
[![agentmods](https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-pod-crashloop/github.svg)](https://agentmods.dev/skills/kudig-io/kudig-database/k8s-pod-crashloop)
Your own site
<a href="https://agentmods.dev/skills/kudig-io/kudig-database/k8s-pod-crashloop"><img src="https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-pod-crashloop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8s-pod-crashloop

Your own site · 80×15
<a href="https://agentmods.dev/skills/kudig-io/kudig-database/k8s-pod-crashloop"><img src="https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-pod-crashloop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,393 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.04393
Opus 5.5 $0.00000 $0.01757
Sonnet 5.5 $0.00000 $0.00879
Haiku 4.5 $0.00000 $0.00439

Measured 1mo ago against content hash 9de7789ace1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

k8s-pod-crashloop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/diagnose-deep.sh, scripts/diagnose-quick.sh, scripts/verify-pod.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

19-故障诊断/08-技能体系/skill-set/k8s-pod-crashloop/SKILL.md · 353 lines

How it starts

The opening of the file, as written. The whole thing — 353 lines — stays where its author put it; the contents beside it link to each section on GitHub.

生产环境安全提示

本文档包含可直接执行的运维命令。执行前请确认:当前目标集群与 Namespace 是否正确;是否具备足够的 RBAC 权限;是否已在非生产环境验证。命令风险等级标注:🔴 高风险(可能造成数据丢失或服务中断)、🟡 中风险(会修改集群状态,但通常可回滚)、🟢 低风险/只读(信息收集,无副作用)。

Pod CrashLoopBackOff / OOMKilled 诊断与修复

概述

Pod CrashLoopBackOff 和 OOMKilled 是 [[kubernetes|Kubernetes]] 工作负载中最常见的问题类型。本 Skill 覆盖从症状识别到修复验证的完整闭环。

典型触发场景:

  1. 应用代码异常导致容器反复退出(退出码 1)
  2. 内存限制过低触发 OOMKilled(退出码 137)
  3. 健康检查配置不当导致误判
  4. 启动依赖未就绪(如数据库连接失败)

症状识别

# 症状描述 检测方法 置信度 排除条件
S1 Pod 状态 CrashLoopBackOff `kubectl get [[Pods pods]]` 0.95
S2 Pod 状态 OOMKilled kubectl describe pod 0.95 节点内存充足但 limit 过低
S3 Restart Count 持续增长 kubectl get pods 0.90 手动滚动更新期间
S4 应用日志含 ERROR/FATAL kubectl logs --previous 0.85 日志级别配置错误

快速诊断

# 15 秒快速诊断
./scripts/diagnose-quick.sh <namespace> <pod-name>

深度诊断

# 2-5 分钟深度诊断
./scripts/diagnose-deep.sh <namespace> <pod-name>

修复动作

低风险修复(L2 自动)

# 修复动作 适用场景 风险
R1 增加内存 limit OOMKilled,节点内存充足 低
R2 调整健康检查阈值 启动慢导致探针失败 低
R3 更新 ConfigMap 配置错误导致启动失败 低

中风险修复(需确认)

# 修复动作 适用场景 风险
R4 回滚 Deployment 新版本引入 Bug 中(回滚影响)
R5 强制删除 Pod Pod 卡在 Terminating 中(数据丢失风险)

高风险修复(人工执行)

# 修复动作 适用场景 风险
R6 修改节点内核参数 系统级限制导致崩溃 高

危险操作

  • 动作: kubectl delete pod <pod> --force --grace-period=0
    • 风险: 强制删除可能导致数据不一致或 [[statefulset|StatefulSet]] 状态异常
    • 确认要求: 是
  • 动作: 修改 StatefulSet 的 volumeClaimTemplates
    • 风险: 可能导致 PVC 丢失或数据不可访问
    • 确认要求: 是

验证修复

# 修复后验证
./scripts/verify-pod.sh <namespace> <pod-name>

验证检查项:

  1. Pod 状态为 Running
  2. 容器 Ready=true
  3. Restart Count 未增加
  4. 无 OOMKilled 记录
  5. 日志无 ERROR/FATAL

升级条件

  • 修复后 5 分钟内 Pod 仍 CrashLoopBackOff → 升级至 SKILL-WORK-001
  • 涉及数据库/消息队列有状态服务 → 升级至 SKILL-STORE-001
  • 集群级多 Pod 同时问题 → 升级至 SKILL-NODE-001

Read the full file on GitHub · 353 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +19 lines 9de7789ace1e
  2. 1mo ago First seen · 334 lines · 0 tokens per session scan A b4a8253ee496

Subscribe to this mod's changes

k8s-pod-crashloop is a skill published in the GitHub repository kudig-io/kudig-database (6 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 4,393 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.