スキル一覧に戻る
JaySon-Huang

copy-logs-from-k8s

by JaySon-Huang

0🍴 0📅 2026年1月21日
GitHubで見るManusで実行

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 kubectl points 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 container serverlog)
  • s3clean: /tmp/s3clean.log -> ./<pod>/s3clean.log

Notes

  • tiflash logs use kubectl exec ... cat because filenames can include : which breaks kubectl 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 in sources within main():
    • Set pod_predicate to match pod names.
    • Use log_dir to copy a directory or single_file for one file.
    • Set container if the pod requires a specific container.
    • Set use_exec_copy=True if kubectl cp fails or filenames include :.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

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

レビュー

💬

レビュー機能は近日公開予定です