agentleFS
AWSKnown publisherawslabs/do-agent-aws/Container-Root/agent/skills/k8s-config-persistence-trap/SKILL.md

k8s-config-persistence-trap

Skill3 starsChanged 3 days agoApache-2.0View on GitHub

Use when a previously-working fix stops working after pod restart or eviction, when sed changes to files on pods are lost, when DiskPressure causes pod eviction and fixes disappear, or when debugging a regression that is actually a lost configuration.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    First check on fresh pods: verify ALL config matches last-known-good

    line 29
  2. Distinctive:

    Before investigating ANY new failure after pod restart:

    line 33
  3. Distinctive:

    If config doesn't match → restore it first, test, THEN investigate if still broken.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

K8s Config Persistence Trap

The Trap

Pod-level file changes via sed, echo >, or manual edits are LOST when:

  • Pod is evicted (DiskPressure, OOM, preemption)
  • Pod is deleted and recreated
  • Node restarts
  • StatefulSet is redeployed

The Cascade

Session 1: sed -i 's/128/4096/' test.py → works
Session 2: Pod evicted → recreated → config=128 again → fails
Session 2: "Must be a new bug!" → 6 hours investigating phantom issues

Prevention

  1. Modify source and commit — not sed on pod
  2. Use environment variables — survive pod restarts via ConfigMap/spec
  3. Bake into Docker image — immutable config
  4. First check on fresh pods: verify ALL config matches last-known-good

Diagnostic

Before investigating ANY new failure after pod restart:

# Check if the critical config is applied
grep recv_tokens /workspace/test.py     # Should show the fixed value
grep NIXL_DEEPEP_NUM /proc/1/environ    # Should show env vars
diff <(kubectl exec pod -- cat file) local_file  # Should match

If config doesn't match → restore it first, test, THEN investigate if still broken.

<!-- imported on 2026-10-31 by tools/import-skills.py from a native Claude Code instance's skill library; the source site's names, ids, hosts and paths are scrubbed to <placeholders>; its other files were not copied -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.