Launch ephemeral debug container in running pod for interactive debugging. Use when you need to debug a pod without restarting it.
From workflowsnpx claudepluginhub eveld/claude --plugin workflowsThis skill uses the workspace's default tool permissions.
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>