← Back to list

copy-logs-from-k8s
by JaySon-Huang
⭐ 0🍴 0📅 Jan 21, 2026
SKILL.md
name: copy-logs-from-k8s description: Use when you need to download tikv/tiflash/s3clean logs from a Kubernetes cluster using scripts/copy_logs_from_k8s.py, including selecting specific sources and saving per-pod folders.
Copy Logs From K8s
Quick Start
- Ensure
kubectlpoints to the target cluster. - Run from the analysis directory so logs are saved there:
python3 .codex/copy-logs-from-k8s/scripts/copy_logs_from_k8s.py
- Download specific sources:
python3 scripts/copy_logs_from_k8s.py --sources tikv
python3 scripts/copy_logs_from_k8s.py --sources tikv,tiflash
- Or specify sources directly from the analysis directory:
python3 .codex/copy-logs-from-k8s/scripts/copy_logs_from_k8s.py --sources tiflash
Outputs
- Logs are saved under
./<pod-name>/...in the current working directory. - tikv:
/var/lib/tikv/log - tiflash:
/data0/logs(uses containerserverlog) - s3clean:
/tmp/s3clean.log->./<pod>/s3clean.log
Notes
- tiflash logs use
kubectl exec ... catbecause filenames can include:which breakskubectl cp. - Large log sets can take time to copy; re-run safely if interrupted.
Extend To Other Pods
- Edit
scripts/copy_logs_from_k8s.py. - Add the new source name to
AVAILABLE_SOURCES. - Add a
LogSource(...)entry insourceswithinmain():- Set
pod_predicateto match pod names. - Use
log_dirto copy a directory orsingle_filefor one file. - Set
containerif the pod requires a specific container. - Set
use_exec_copy=Trueifkubectl cpfails or filenames include:.
- Set
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon