k8s-debug
Launch ephemeral debug container in running pod for interactive debugging. Use when you need to debug a pod without restarting it.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Launch ephemeral debug container in running pod for interactive debugging. Use when you need to debug a pod without restarting it.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Generic migration orchestrator that reads CHANGELOG.md to understand and execute version-specific migrations
Determine feature slug interactively by auto-detecting next number and prompting user for description
Share personal documents to the shared namespace with atomic git commit and push
Use when creating implementation plans to generate properly structured plans with phases, success criteria, and project references.
Use when documenting research findings to create properly structured research documents with frontmatter, sections, and file references.
ALWAYS check this skill before using grep, glob, Task tool, or doing any codebase exploration. Guides you to use specialized agents that are more efficient than basic tools.
| name | k8s-debug |
| description | Launch ephemeral debug container in running pod for interactive debugging. Use when you need to debug a pod without restarting it. |
Launch an ephemeral debug container attached to a running pod for interactive debugging.
# Check kubectl context
kubectl config current-context || {
echo "No kubectl context. Run: kubectl config use-context <context>"
exit 1
}
# Show current context
echo "K8s Context: $(kubectl config current-context)"
Basic debug container:
# Attach ephemeral debug container to running pod
kubectl debug -it <pod-name> \
--image=nicolaka/netshoot \
--namespace=<namespace>
With specific container target (for multi-container pods):
# Target specific container in pod
kubectl debug -it <pod-name> \
--image=nicolaka/netshoot \
--target=<container-name> \
--namespace=<namespace>
With custom image:
# Use custom debug image
kubectl debug -it <pod-name> \
--image=ubuntu:latest \
--namespace=<namespace>
Once inside the debug container, use these commands:
Network debugging:
# Test HTTP endpoints
curl http://localhost:8080/health
curl -v http://database-service:5432
# Check listening ports
netstat -tulpn
# Capture network traffic
tcpdump -i any port 8080
# DNS resolution
nslookup database-service
dig +short database-service.default.svc.cluster.local
Process inspection:
# List processes
ps aux
# Monitor processes
top
# Check process details
ps aux | grep api-gateway
File system inspection:
# Check application directory
ls -la /app
# View config files
cat /app/config.yaml
# Check environment variables
env | grep API
# Check mounted volumes
df -h
mount | grep /app
Container metadata:
# Check container env
printenv
# View pod labels (if tools available)
cat /etc/podinfo/labels
After debugging:
exit or Ctrl+Dnicolaka/netshoot (Recommended for network debugging):
busybox:
ubuntu:latest:
alpine:latest:
--target when debugging multi-container pods--copy-to=<new-pod-name> to create a copy of the pod for debuggingkubectl get pod <pod-name> -n <namespace>