agentleFS
jholhewresjholhewres/devclaw-skills/skills/kubernetes/SKILL.md

kubernetes

Skill4 starsChanged 9 months agoMITView on GitHub

Manage Kubernetes clusters via kubectl

  • Installs packages

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Use -o yaml or -o json for detailed output

    line 107
  2. Very specific:

    Use --watch to monitor changes in real time

    line 108
  3. Very specific:

    Use -l app=myapp to filter by labels

    line 109
  4. Very specific:

    Always specify -n <namespace> to avoid surprises

    line 110

“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “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

Manage Kubernetes clusters via kubectl.

Setup

  1. Check if installed:
    command -v kubectl && kubectl version --client
  2. Install:
    # macOS
    brew install kubectl
    
    # Ubuntu / Debian
    curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
    chmod +x kubectl && sudo mv kubectl /usr/local/bin/
    
    # Or via apt (see https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/)
    sudo apt update && sudo apt install -y kubectl

Basics

# Pods
kubectl get pods -A                          # all namespaces
kubectl get pods -n <ns> -o wide             # with IPs and nodes
kubectl describe pod <pod> -n <ns>
kubectl logs <pod> -n <ns> --tail=100
kubectl logs <pod> -n <ns> -c <container>    # multi-container
kubectl exec -it <pod> -n <ns> -- sh

# Deployments
kubectl get deployments -n <ns>
kubectl describe deployment <name> -n <ns>
kubectl scale deployment <name> --replicas=3 -n <ns>
kubectl rollout status deployment <name> -n <ns>
kubectl rollout restart deployment <name> -n <ns>
kubectl rollout undo deployment <name> -n <ns>

# Services
kubectl get svc -n <ns>
kubectl describe svc <name> -n <ns>
kubectl port-forward svc/<name> 8080:80 -n <ns>

# ConfigMaps and Secrets
kubectl get configmap -n <ns>
kubectl get secret -n <ns>
kubectl get secret <name> -n <ns> -o jsonpath='{.data}'

Diagnostics

# Events (useful for debug)
kubectl get events -n <ns> --sort-by='.lastTimestamp'

# Top (metrics)
kubectl top pods -n <ns>
kubectl top nodes

# Nodes
kubectl get nodes -o wide
kubectl describe node <name>
kubectl cordon <node>    # mark unschedulable
kubectl drain <node> --ignore-daemonsets --delete-emptydir-data

Apply & Delete

# Apply manifest
kubectl apply -f <file.yaml>
kubectl apply -f <directory>/

# Dry run
kubectl apply -f <file.yaml> --dry-run=client

# Delete
kubectl delete -f <file.yaml>
kubectl delete pod <pod> -n <ns>

Contexts

# List contexts
kubectl config get-contexts

# Switch context
kubectl config use-context <name>

# View current context
kubectl config current-context

Tips

  • Use -o yaml or -o json for detailed output
  • Use --watch to monitor changes in real time
  • Use -l app=myapp to filter by labels
  • Always specify -n <namespace> to avoid surprises

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.

Reviews can't be read right now.

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.