Back to list
XiaoMi

k8s-troubleshoot

by XiaoMi

No description, website, or topics provided

1,151🍴 178📅 Jan 23, 2026

SKILL.md


name: k8s-troubleshoot description: Kubernetes troubleshooting toolkit - search pods by labels and execute diagnostic commands inside containers. Use when user reports service errors, exceptions, crashes, timeouts, or needs to check logs, processes, network, or resource usage in K8s pods.

Kubernetes Troubleshooting Skill

A complete toolkit for diagnosing Kubernetes applications. Find pods by labels, then execute commands inside containers for deep diagnostics.

When to Use

  • User reports service errors, exceptions, failures, timeouts
  • Need to check application logs or process status
  • Diagnose network, memory, or disk issues
  • Keywords: error, exception, failed, timeout, crash, not working, logs, troubleshoot, diagnose, pod, container

Workflow

  1. Search pods - Find target pods by label selector
  2. Execute diagnostics - Run commands inside containers

Scripts

1. Search Pods

Find pods by label selector:

uv run python .claude/skills/k8s-troubleshoot/scripts/search_pods.py -l "app=nginx" -n default
ParameterRequiredDescription
-l, --label-selectorYesLabel selector, e.g., app=nginx or project-id=123,pipeline-id=456
-n, --namespaceNoNamespace (default: default). Use all for all namespaces

Output: JSON with success, podCount, pods (name, namespace, phase, containers)

2. Execute Command in Pod

Run diagnostic commands inside a container:

uv run python .claude/skills/k8s-troubleshoot/scripts/exec_pod.py -p "pod-name" -n default -cmd "tail -n 100 /root/logs/app.log"
ParameterRequiredDescription
-p, --podYesPod name
-n, --namespaceNoNamespace (default: default)
-c, --containerNoContainer name (for multi-container pods)
-cmd, --commandYesCommand to execute

Output: JSON with success, pod, namespace, command, output

Common Diagnostic Patterns

View application logs

uv run python .claude/skills/k8s-troubleshoot/scripts/exec_pod.py -p my-pod -n default -cmd "tail -n 100 /root/logs/app.log"

Check Nacos config (dubbo3 issues)

uv run python .claude/skills/k8s-troubleshoot/scripts/exec_pod.py -p my-pod -n default -cmd "cat /root/logs/nacos/config.log | grep nacos"

Check processes

uv run python .claude/skills/k8s-troubleshoot/scripts/exec_pod.py -p my-pod -n default -cmd "ps aux | head -20"

Check network

uv run python .claude/skills/k8s-troubleshoot/scripts/exec_pod.py -p my-pod -n default -cmd "netstat -tlnp"

Check disk and memory

uv run python .claude/skills/k8s-troubleshoot/scripts/exec_pod.py -p my-pod -n default -cmd "df -h && free -m"

Troubleshooting Tips

IssueDiagnostic Command
dubbo3 no providerCheck /root/logs/nacos/config.log for nacos address
Service not respondingCheck process status with ps aux and logs
Connection issuesCheck network with netstat -tlnp
OOM errorsCheck memory with free -m

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 1000以上

+15
最近の活動

3ヶ月以内に更新

+5
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

0/5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon