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.zip

Installs 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)
52 charsno explicit “when” trigger
Beginner

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

You give it
Kubernetes Pod names, container names, namespace details
You get back
Pod status, container logs, cluster events, shell access to containers, port-forwarded services

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 上的應用程式問題。

  1. 檢查 Pod 狀態 (Pod Status)

    首先確認 Pod 是否正常運作,或處於錯誤狀態 (如 CrashLoopBackOff, ImagePullBackOff)。

    kubectl get pods -o wide
    

    若發現問題 Pod,查看詳細資訊:

    kubectl describe pod <POD_NAME>
    
  2. 查看應用程式日誌 (Logs)

    檢查容器輸出的標準日誌,尋找錯誤訊息或堆疊追蹤 (Stack Trace)。

    kubectl logs <POD_NAME>
    # 若 Pod 包含多個容器,需指定容器名稱
    # kubectl logs <POD_NAME> -c <CONTAINER_NAME>
    

    若 Pod 不斷重啟,查看上一輪的崩潰日誌:

    kubectl logs <POD_NAME> --previous
    
  3. 檢查叢集事件 (Events)

    查看 Namespace 中的事件,了解排程、掛載或健康檢查失敗的原因。

    kubectl get events --sort-by=.lastTimestamp
    
  4. 進入容器除錯 (Exec)

    若需檢查檔案系統、環境變數或網路連線,可直接進入容器。

    kubectl exec -it <POD_NAME> -- sh
    # 或
    kubectl exec -it <POD_NAME> -- bash
    
    • 檢查環境變數: env
    • 檢查網路連線: curl localhost:8080nc -zv <HOST> <PORT>
  5. 本地端口轉發 (Port Forwarding)

    將 Pod 端口轉發到本地,以便使用瀏覽器或 Postman 進行測試。

    kubectl port-forward <POD_NAME> 8080:8080
    
  6. 資源使用量監控 (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.

SkillInstallsUpdatedSafetyDifficulty
k8s-debug (this skill)04moReviewBeginner
debug-cluster28moReviewIntermediate
agentstack-server-debugging25moReviewIntermediate
k8s-incident16moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry