k8s-configmap-runtime-patch
Skill3 starsChanged 2 days agoApache-2.0View on GitHub
Use when injecting Python patches or config files into containers at runtime without rebuilding images, when base64 encoding makes YAMLs unreadable, or when private repos block curl-based downloads
In this repository37 other files it gives its agents.
- docs/manual/agents.mdAGENTS.md
- ablate-combined-changesSkill
- agent-supervisor-methodologySkill
- benchmark-comparisonSkill
- browser-vlm-acceptanceSkill
- claim-verificationSkill
- claude-code-best-practicesSkill
- code-attributionSkill
- comms-connectSkill
- condition-based-waitingSkill
- conference-intelligenceSkill
- deep-research-methodologySkill
- defense-in-depthSkill
- detect-deployment-thrashingSkill
- directory-cross-examinationSkill
- doc-freshness-auditorSkill
- eval-harnessSkill
- github-comment-managerSkill
- github-deep-researchSkill
- github-issue-responseSkill
- harness-setupSkill
- issue-closure-strategistSkill
- issue-quality-assessmentSkill
- k8s-config-persistence-trapSkill
- maintainer-profilingSkill
- measure-before-theorizeSkill
- multi-phase-optimization-campaignSkill
- phase-trackerSkill
- pptx-slide-creationSkill
- pr-issue-scannerSkill
- public-root-reproducibilitySkill
- repo-organizerSkill
- root-cause-tracingSkill
- technique-versioning-workflowSkill
- wrong-layer-debuggingSkill
- wrong-theory-cascade-preventionSkill
- youtube-transcriberSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Distinctive: line 80
Idempotent: Check for marker before patching
≈ “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.
Files
K8s ConfigMap Runtime Patching
Overview
Mount Python patch scripts as ConfigMaps into containers at runtime. Avoids base64-encoded blobs in YAMLs, doesn't depend on GitHub access (works with private repos), and patches are version-controlled separately.
When to Use
- Container image has a bug you can't rebuild for
- YAML has unreadable base64-encoded patches
- Private repo blocks
curlfrom downloading patches - Need to iterate patches without rebuilding images
- Multiple manifests need the same patches
Pattern
1. Create patch files in repo
patches/
patch_worker_v5.py # Standalone Python scripts
patch_grpo_v9.py # Each is self-contained, idempotent2. Create ConfigMap from files
kubectl create configmap nemo-rl-patches \
--from-file=patch_worker_v5.py=patches/patch_worker_v5.py \
--from-file=patch_grpo_v9.py=patches/patch_grpo_v9.py \
--dry-run=client -o yaml > deploy/kubernetes/patches-configmap.yaml
kubectl apply -f deploy/kubernetes/patches-configmap.yaml3. Mount in pod spec
volumes:
- name: patches
configMap:
name: nemo-rl-patches
# ...
containers:
- volumeMounts:
- name: patches
mountPath: /opt/patches
readOnly: true4. Run patches at startup
command: ["/bin/bash", "-c"]
args:
- |
python3 /opt/patches/patch_worker_v5.py
python3 /opt/patches/patch_grpo_v9.py
# ... rest of startupPatch Script Best Practices
#!/usr/bin/env python3
"""Each patch must be idempotent."""
f = '/path/to/target.py'
c = open(f).read()
if 'PATCH_MARKER_V1' in c:
print('Already patched')
exit(0)
# Apply patch...
open(f, 'w').write(modified)
print('PATCH_MARKER_V1: Applied')Key rules:
- Idempotent: Check for marker before patching
- Versioned markers:
PATCH_V1,PATCH_V2etc. - Print confirmation: Log what was patched
- Clean .pyc after:
find /path -name '*.pyc' -delete
Comparison of Approaches
| Approach | Readability | Private Repo | Iteration Speed |
| Base64 in YAML | Poor | Works | Must re-encode |
| curl from GitHub | Good | Fails | Push + redeploy |
| ConfigMap mount | Good | Works | kubectl apply |
| Rebuild image | N/A | Works | Slow (minutes) |
<!-- 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 -->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
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.

