agentleFS
nb-99nb-99/skillektion/skills/k8s-ops/SKILL.md

k8s-ops

Skill1 starsChanged 3 months agoMITView on GitHub

Work safely with Kubernetes clusters via kubectl (and helm). Use for inspecting workloads, debugging pods, reading logs, and applying manifests. Front-loads read-first/confirm-before-mutate norms and common diagnostic recipes.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 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.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default to read-only investigation.

    line 8
  2. Very specific:

    Never run delete/drain/apply against a prod context without an explicit go-ahead naming the cluster.

    line 77
  3. Distinctive:

    Prefer label selectors over bare names for bulk reads.

    line 79
  4. Very specific:

    Avoid kubectl edit in agentic flows — prefer apply from a reviewed manifest so the change is diffable and reversible.

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Kubernetes operations

Default to read-only investigation. Any mutating or destructive command (delete, apply, scale, rollout restart, cordon, drain, edit) requires explicit confirmation first — and confirm the active context/namespace before running it.

Always know where you are

kubectl config current-context
kubectl config get-contexts
kubectl config use-context CONTEXT          # switch cluster — confirm intent
kubectl config set-context --current --namespace NS

State the target context + namespace before any write.

Inspect

kubectl get pods -A                          # or -n NS
kubectl get deploy,svc,ingress -n NS
kubectl describe pod POD -n NS
kubectl get events -n NS --sort-by=.lastTimestamp
kubectl get pod POD -n NS -o yaml

Debug

kubectl logs POD -n NS                        # add -c CONTAINER for multi-container
kubectl logs POD -n NS --previous            # crashed/restarted container
kubectl logs -f deploy/NAME -n NS            # follow a deployment's pods
kubectl exec -it POD -n NS -- sh
kubectl port-forward svc/NAME -n NS 8080:80
kubectl top pod -n NS                         # needs metrics-server

Mutations (confirm first)

kubectl apply -f FILE.yaml -n NS              # prefer: kubectl diff -f FILE first
kubectl rollout restart deploy/NAME -n NS
kubectl rollout status deploy/NAME -n NS
kubectl scale deploy/NAME --replicas=N -n NS
kubectl delete pod POD -n NS                  # destructive
kubectl drain NODE --ignore-daemonsets       # destructive — node maintenance

Preview before applying: kubectl diff -f FILE.yaml -n NS.

Helm (if used)

helm list -n NS
helm get values RELEASE -n NS
helm diff upgrade RELEASE CHART -n NS         # needs helm-diff plugin
helm upgrade RELEASE CHART -n NS              # WRITE: confirm first

ArgoCD (if used)

argocd app list
argocd --core --refresh app get APP_NAME
argocd --core --refresh app sync APP_NAME # WRITE: confirm first

Safety notes

  • Never run delete/drain/apply against a prod context without an explicit go-ahead naming the cluster.
  • Prefer label selectors over bare names for bulk reads; never for bulk deletes without review.
  • Avoid kubectl edit in agentic flows — prefer apply from a reviewed manifest so the change is diffable and reversible.

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.