agentleFS
abevzabevz/devops-skills/skills/kubernetes-debug/SKILL.md

kubernetes-debug

Skill0 starsChanged 41 days agoMITView on GitHub

Use when debugging a Kubernetes issue such as a failing pod, broken service, or unexpected cluster behavior. Mention "kubectl", "pod is crashing", "debug this deployment", "kubernetes issue" as triggers.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    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 read-only kubectl get, describe, and logs before proposing a mutation.

    line 18
  2. Distinctive:

    Do not restart or delete a resource as a substitute for finding the cause.

    line 22
  3. Distinctive:

    Follow the Workflow, Safety rules, and Quality checklist below.

    line 26
  4. Distinctive:

    Use when a Kubernetes-hosted workload is failing, not starting, not receiving traffic, or behaving unexpectedly, and the cause needs to be …

    line 37
  5. Distinctive:

    Use the general workflow below when the symptom doesn't match a playbook or spans several.

    line 60
  6. Very specific:

    Prefer read-only kubectl get/describe/logs commands first, always.

    line 94
  7. Very specific:

    Do not run kubectl apply, delete, edit, rollout restart, scale, cordon, or drain unless the user explicitly asks for the mutation.

    line 95
  8. Very specific:

    Never print the contents of a Secret value — only confirm existence/keys.

    line 97
  9. Distinctive:

    If a fix requires applying a manifest, show the diff/manifest and the exact command.

    line 98

≈ “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 Debug

TL;DR checklist

  • Name the namespace, workload, and exact symptom.
  • Inspect status, events, logs, owner, and the relevant networking or storage objects.
  • Tie a proposed fix to the observed cause and a verification check.

Key read-only checks

  • Use read-only kubectl get, describe, and logs before proposing a mutation.

Common pitfalls

  • Do not restart or delete a resource as a substitute for finding the cause.

Agent procedure

Follow the Workflow, Safety rules, and Quality checklist below.

Quick references

  • references/playbooks.md
  • references/conditional/managed-clusters.md

Last verified: unverified

When to use

Use when a Kubernetes-hosted workload is failing, not starting, not receiving traffic, or behaving unexpectedly, and the cause needs to be diagnosed.

Goal

Find the probable cause using read-only inspection, with commands the user can run to confirm, and a safe fix — without mutating cluster state unless explicitly asked.

Diagnostic routing

Identify the symptom first, then jump straight to its playbook in references/playbooks.md instead of walking the full checklist:

SymptomPlaybook section
Pod stuck PendingPod Pending — scheduler event text → cause table
CrashLoopBackOffCrashLoopBackOff — exit code/reason → cause table
ImagePullBackOff / ErrImagePullImagePull — pull error text → cause table
OOMKilled restartsOOMKilled — usage-pattern classification
Service unreachable / connection refusedService chain — 6-link walk (selector → endpoints → readiness → ports → bind address → NetworkPolicy)
Name resolution errors / 5s latenciesDNS — CoreDNS, FQDN vs short names, ndots, netpol on port 53
Node NotReadyNode — conditions → pressure/kubelet/CNI

Use the general workflow below when the symptom doesn't match a playbook or spans several. On a managed cloud cluster (EKS/GKE/AKS), also load references/conditional/managed-clusters.md — control-plane logs live in the cloud backend, nodes auto-remediate (hiding the cause), and IPAM/LB/IAM issues masquerade as k8s issues (e.g. EKS ENI IP exhaustion → stuck ContainerCreating).

Workflow

  1. Narrow scope: namespace, workload name, and symptom (CrashLoopBackOff, Pending, no traffic, OOMKilled, etc.) — and route via the table above if it matches a playbook.
  2. Inspect in this order, read-only:
    • kubectl get pods / describe pod — status, restart count, events
    • kubectl get events --sort-by=.lastTimestamp — recent cluster events in the namespace
    • kubectl logs (current and --previous if crashed) — actual error output
    • the owning controller (Deployment/StatefulSet/DaemonSet) — replica status, rollout status
    • Service + Endpoints/EndpointSlice — selector match, ready addresses
    • Ingress/Gateway API resources — routing and backend health
    • referenced ConfigMap/Secret — do they exist, are keys present (never print secret values)
    • ServiceAccount and RBAC (Role/RoleBinding) — permission errors in logs/events
    • node status and describe node — pressure, taints, allocatable resources, if scheduling is stuck
    • probes and resource requests/limits on the pod spec
    • NetworkPolicy — if connectivity is denied unexpectedly
  3. Correlate evidence to a probable cause before proposing a fix.
  4. Propose the safe fix, and the exact commands to verify it worked.

References

  • references/playbooks.md — symptom-keyed diagnosis trees (Pending, CrashLoop exit codes, ImagePull error text, OOM, service chain, DNS, node, CPU throttling, cascading liveness).
  • references/conditional/managed-clusters.md — EKS/GKE/AKS debugging caveats (hidden control- plane logs, node auto-remediation, ENI IP exhaustion, LB/IAM masquerading), loaded by signal.

Safety rules

  • Prefer read-only kubectl get/describe/logs commands first, always.
  • Do not run kubectl apply, delete, edit, rollout restart, scale, cordon, or drain unless the user explicitly asks for the mutation.
  • Never print the contents of a Secret value — only confirm existence/keys.
  • If a fix requires applying a manifest, show the diff/manifest and the exact command; let the user run it, or only run it yourself after explicit confirmation.

Output format

## Observations
<what was seen, from which command>

## Evidence
<relevant log lines / events / describe output, quoted>

## Probable cause
## Commands to verify
## Safe fix
<manifest/command, plus explicit note that it requires user confirmation to apply>

Quality checklist

  • Only read-only commands were run without explicit permission
  • Probable cause is backed by quoted evidence, not guessed
  • No secret values were printed
  • The proposed fix includes a verification step
  • Any mutating command is clearly marked as requiring confirmation

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.