k8s-clean-cluster

k8s-clean-cluster is a skill for Claude Code, Codex from kurtosis-tech/kurtosis. It costs 59 tokens per session (739 once invoked), scanned A, original, Apache-2.0.

A guide for forcibly removing Kurtosis resources from a Kubernetes cluster when normal cleanup fails. Kubernetes is a system for running and managing containers across a cluster.

In plain words
What is it for?
Use it when `kurtosis clean -a` hangs, failed cleanup leaves resources behind, pods remain stuck, or an old installation blocks engine startup.
Why use it?
It clears leftover namespaces, pods, and access-control resources that can prevent Kurtosis from starting again.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it when kurtosis clean -a hangs, failed cleanup leaves resources behind, pods remain stuck, or an old installation blocks engine startup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kurtosis-tech/kurtosis/k8s-clean-cluster
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 kurtosis-tech/kurtosis --skill k8s-clean-cluster
Clone the repo
git clone --depth 1 https://github.com/kurtosis-tech/kurtosis

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-clean-cluster

README.md
[![agentmods](https://agentmods.dev/badge/skills/kurtosis-tech/kurtosis/k8s-clean-cluster/github.svg)](https://agentmods.dev/skills/kurtosis-tech/kurtosis/k8s-clean-cluster)
Your own site
<a href="https://agentmods.dev/skills/kurtosis-tech/kurtosis/k8s-clean-cluster"><img src="https://agentmods.dev/badge/skills/kurtosis-tech/kurtosis/k8s-clean-cluster/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-clean-cluster

Your own site · 80×15
<a href="https://agentmods.dev/skills/kurtosis-tech/kurtosis/k8s-clean-cluster"><img src="https://agentmods.dev/badge/skills/kurtosis-tech/kurtosis/k8s-clean-cluster.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 739 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00059 $0.00739
Opus 5 $0.00030 $0.00369
Sonnet 5 $0.00012 $0.00148
Haiku 4.5 $0.00006 $0.00074

Measured 11d ago against content hash 2efe2dbe5b0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

k8s-clean-cluster 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 11d ago.

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.

skills/k8s-clean-cluster/SKILL.md · 92 lines

How it starts

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

K8s Clean Cluster

Force-clean all Kurtosis resources from a Kubernetes cluster when the normal kurtosis clean -a command hangs or fails.

When to use

  • kurtosis clean -a hangs for more than a few minutes
  • Orphaned kurtosis namespaces remain after a failed clean
  • remove-dir-pod-* pods are stuck in Pending state
  • Engine start fails because old resources exist

Steps

1. Kill any running kurtosis processes

pkill -f "kurtosis gateway" 2>/dev/null
pkill -f "kurtosis clean" 2>/dev/null

2. Stop the engine gracefully (if possible)

kurtosis engine stop || true

3. Delete all kurtosis namespaces

# List them first
kubectl get ns | grep kurtosis

# Delete all kurtosis namespaces (engine, enclaves, logs)
kubectl get ns | grep kurtosis | awk '{print $1}' | xargs -r kubectl delete ns --force --grace-period=0

4. Clean up cluster-scoped resources

# Delete kurtosis cluster roles
kubectl get clusterrole | grep kurtosis | awk '{print $1}' | xargs -r kubectl delete clusterrole

# Delete kurtosis cluster role bindings
kubectl get clusterrolebinding | grep kurtosis | awk '{print $1}' | xargs -r kubectl delete clusterrolebinding

5. Clean up stuck pods

# Force-delete any remaining kurtosis pods
kubectl get pods -A | grep kurtosis | awk '{print $2 " -n " $1}' | xargs -L1 kubectl delete pod --force --grace-period=0

# Clean up evicted pods
kubectl get pods -A | grep Evicted | awk '{print $2 " -n " $1}' | xargs -L1 kubectl delete pod --force --grace-period=0

6. Verify clean state

kubectl get ns | grep kurtosis
kubectl get pods -A | grep kurtosis
kubectl get ds -A | grep kurtosis

All three commands should return empty results.

7. Restart

kurtosis engine start
kurtosis gateway &

Why clean hangs

The most common cause is the fluentbit logs collector Clean method which:

  1. Evicts all DaemonSet pods by adding a non-existent node selector
  2. Waits for each pod to terminate (up to 5 min per pod, sequentially)
  3. Creates remove-dir-pod cleanup pods targeted at each node
  4. Cleanup pods on tainted/unhealthy nodes get stuck in Pending

Read the full file on GitHub · 92 lines

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. 11d ago First seen · 92 lines · 59 tokens per session scan A 2efe2dbe5b0c

Subscribe to this mod's changes

k8s-clean-cluster is a skill published in the GitHub repository kurtosis-tech/kurtosis (551 stars, last pushed 2d ago), licensed Apache-2.0. It adds 59 tokens to every session and 739 once invoked, about $0.0003 per session on Opus 5. 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-30.

Related

Other skills, from other repositories

harbor

CLI toolkit for managing containerized LLM services. Use when the user wants to start, stop, configure, or manage AI/LLM services like Ollama, Open WebUI, llama.cpp, vLLM, LiteLLM, ComfyUI, and 250+ others. Triggers on requests to "run a model", "start ollama", "set up an LLM", "configure harbor", "manage services"…

av/harbor · 114 tokens

branchbox-devcontainer-guardrails

Use when modifying BranchBox devcontainer/bootstrap workflows, compose templates, feature env-stash behavior, or manual E2E harness/release docs. Apply issue.

branchbox/branchbox · 39 tokens

l337-docker

Drive Docker through the docker CLI - containers, images, networks, volumes, Compose, Swarm services/stacks/nodes/secrets, buildx, Scout, OCI registries, plugins, contexts and remote daemons. Covers inspection, deployment, debugging, security auditing, build/publish and cleanup, with bounded output and a confirmation…

L337-org/docker-mcp · 131 tokens

ilo

Run builds, tests, and other tooling inside a reproducible, containerized dev environment via the ilo CLI instead of on the host. Use this whenever a project relies on ilo, devcontainers, or container-based build environments — it has a .ilo.rc / .ilo/ilo.rc, dev/ argument files, a Containerfile/Dockerfile, a…

metio/ilo · 181 tokens

dev-environment-setup

Use this skill as a router/index when the user faces a development environment question that spans multiple domains: containers (Docker/Podman), WSL2 on Windows, office-skill dependencies (DOCX/PDF/XLSX/ PPTX), or system tools (LibreOffice/Poppler/Pandoc/Tesseract). For pure Python issues use python-runtime skill; for…

desirecore/market · 202 tokens

docker-containerization

Containerize applications with multi-stage Dockerfiles, Docker Compose orchestration, image optimization, and container security. Covers Python, Node.js, and multi-service architectures. Triggers on Docker, containerization, or container orchestration requests.

organvm-iv-taxis/a-i--skills · 50 tokens