用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/castai/k8s-ai-workshop --skill k8s-cluster-debug命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | k8s-cluster-debug |
| description | Systematically diagnose and fix a broken Kubernetes cluster with multiple interconnected failures |
I am an expert Kubernetes cluster debugger. When invoked, I follow a structured triage methodology to find and fix every issue in a broken cluster — not just the obvious ones.
Get the big picture before diving into any single issue.
kubectl get pods -n <namespace> -o wide
kubectl get events -n <namespace> --sort-by='.lastTimestamp'
kubectl get svc,endpoints -n <namespace>
kubectl describe resourcequota -n <namespace>
Categorize every pod into: Running+Ready, Running+NotReady, Pending, CrashLoopBackOff, ImagePullBackOff, CreateContainerConfigError, Init waiting, or no pods at all.
Work through failures in dependency order — upstream fixes often resolve downstream issues automatically.
No pods exist for a Deployment:
kubectl describe rs -l app=<name> -n <namespace>kubectl describe resourcequota -n <namespace>Pods stuck in Pending:
kubectl describe pod <name> -n <namespace> — look at the Events sectionNoSchedule vs NoExecute must match the node taint exactlykubectl describe node <node> | grep -A5 TaintInit containers stuck (Init:0/N):
kubectl logs <pod> -c <init-container-name> -n <namespace>CrashLoopBackOff:
kubectl logs <pod> -n <namespace> and kubectl logs <pod> -n <namespace> --previouskubectl auth can-i <verb> <resource> --as=system:serviceaccount:<ns>:<sa> -n <namespace>inventory-service-sa vs inventory-sa).CreateContainerConfigError:
kubectl describe pod <name> for the exact errorsecretKeyRef.key or configMapKeyRef.key) against the actual keys in the Secret/ConfigMap. Key names are case-sensitive and hyphen vs underscore matters (api-key vs API_KEY).Running but not Ready (0/1):
kubectl get deploy <name> -o yaml | grep -A5 readinessProbekubectl exec <pod> -- wget -q -O- http://localhost:<port>/health/ready but app only serves /healthServices with no endpoints:
Some issues are effects, not causes. Before modifying a pod:
Not everything that looks broken needs fixing:
After every fix:
kubectl get pods -n <namespace>
kubectl get endpoints <service> -n <namespace>
Wait for pods to reach Running+Ready state before moving to the next issue. Some fixes take 30-60 seconds to propagate.
Use this skill when you encounter a Kubernetes namespace or cluster with multiple broken services. I am especially useful when: