k8s-debug
A diagnostic workflow for Kubernetes to identify and resolve Pod, container, and event-related issues.
Install
mkdir -p .claude/skills/k8s-debug-vincent119 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14217" && unzip -o skill.zip -d .claude/skills/k8s-debug-vincent119 && rm skill.zipInstalls to .claude/skills/k8s-debug-vincent119
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Kubernetes 應用程式除錯流程 (Pod Status, Logs, Events, Exec)Key capabilities
- →Check Kubernetes Pod status and detailed information
- →View standard logs from containers within Pods
- →Inspect previous container logs after a crash
- →Examine cluster events for scheduling or resource issues
- →Execute shell commands inside running containers for debugging
How it works
The skill provides a structured debugging workflow by guiding users to check Pod status, view logs, inspect cluster events, and execute commands inside containers using `kubectl`.
Inputs & outputs
When to use k8s-debug
- →Debug CrashLoopBackOff errors
- →View container standard logs
- →Inspect scheduling or event failures
- →Execute commands inside a container
- →Forward local ports for testing
About this skill
此工作流程將引導您排查與修復 Kubernetes 上的應用程式問題。
-
檢查 Pod 狀態 (Pod Status)
首先確認 Pod 是否正常運作,或處於錯誤狀態 (如 CrashLoopBackOff, ImagePullBackOff)。
kubectl get pods -o wide若發現問題 Pod,查看詳細資訊:
kubectl describe pod <POD_NAME> -
查看應用程式日誌 (Logs)
檢查容器輸出的標準日誌,尋找錯誤訊息或堆疊追蹤 (Stack Trace)。
kubectl logs <POD_NAME> # 若 Pod 包含多個容器,需指定容器名稱 # kubectl logs <POD_NAME> -c <CONTAINER_NAME>若 Pod 不斷重啟,查看上一輪的崩潰日誌:
kubectl logs <POD_NAME> --previous -
檢查叢集事件 (Events)
查看 Namespace 中的事件,了解排程、掛載或健康檢查失敗的原因。
kubectl get events --sort-by=.lastTimestamp -
進入容器除錯 (Exec)
若需檢查檔案系統、環境變數或網路連線,可直接進入容器。
kubectl exec -it <POD_NAME> -- sh # 或 kubectl exec -it <POD_NAME> -- bash- 檢查環境變數:
env - 檢查網路連線:
curl localhost:8080或nc -zv <HOST> <PORT>
- 檢查環境變數:
-
本地端口轉發 (Port Forwarding)
將 Pod 端口轉發到本地,以便使用瀏覽器或 Postman 進行測試。
kubectl port-forward <POD_NAME> 8080:8080 -
資源使用量監控 (Top)
檢查 Pod 是否因 OOM (Out of Memory) 或 CPU 節流而導致效能問題。
kubectl top pod <POD_NAME>
When not to use it
- →When debugging applications not deployed on Kubernetes
- →When the issue is outside the scope of Pods, logs, events, or container execution
- →When a different container orchestration platform is in use
Limitations
- →The skill is specific to Kubernetes environments
- →The skill relies on `kubectl` commands for debugging
- →Resource usage monitoring requires `kubectl top`
How it compares
This skill offers a systematic, step-by-step approach to Kubernetes application debugging using standard `kubectl` commands, unlike ad-hoc troubleshooting.
Compared to similar skills
k8s-debug side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| k8s-debug (this skill) | 0 | 4mo | Review | Beginner |
| debug-cluster | 2 | 8mo | Review | Intermediate |
| agentstack-server-debugging | 2 | 5mo | Review | Intermediate |
| k8s-incident | 1 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
debug-cluster
openshift
Provides systematic debugging approaches for HyperShift hosted-cluster issues. Auto-applies when debugging cluster problems, investigating stuck deletions, or troubleshooting control plane issues.
agentstack-server-debugging
i-am-bee
Instructions for debugging agentstack-server during development
k8s-incident
rohitg00
Respond to Kubernetes incidents with runbooks and diagnostics. Use for outages, pod failures, node issues, network problems, and emergency response.
k8s-troubleshoot
rohitg00
Debug Kubernetes pods, nodes, and workloads. Use when pods are failing, containers crash, nodes are unhealthy, or users mention debugging, troubleshooting, or diagnosing Kubernetes issues.
terway-troubleshooting
AliyunContainerService
Troubleshoot Terway CNI issues in Kubernetes using Kubernetes events and Terway logs. Use when diagnosing "cni plugin not initialized", Pod create/delete failures, or ENI/IPAM problems in Terway (centralized or non-centralized IPAM).
nav-troubleshoot
navikt
Strukturerte diagnostiske trær for vanlige Nav-plattformproblemer — pod-krasj, auth-feil, Kafka-lag og databaseproblemer