AgentSkillsCN

k8s

掌握 Kubernetes 调试与故障排除技能。调试 Pod、查看日志、验证平台健康状况。

SKILL.md
--- frontmatter
name: k8s
description: Kubernetes debugging and troubleshooting skills. Debug pods, check logs, verify platform health.

Kubernetes Debugging Skills

Skills for debugging and troubleshooting Kubernetes deployments.

Available Sub-Skills

SkillDescription
k8s:podsTroubleshoot pod issues (CrashLoopBackOff, ImagePull, etc.)
k8s:logsQuery and analyze pod/container logs
k8s:healthCheck platform health and component status
k8s:live-debuggingIterative debugging on running clusters

Quick Debugging

Check Pod Status

bash
# All pods
kubectl get pods -A

# Failed pods
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded

# Specific namespace
kubectl get pods -n team1

View Logs

bash
# Agent logs
kubectl logs -n team1 deployment/weather-service --tail=100 -f

# Operator logs
kubectl logs -n kagenti-system -l app=kagenti-operator --tail=100

Check Events

bash
kubectl get events -A --sort-by='.lastTimestamp' | tail -30

Platform Health

bash
# All deployments
kubectl get deployments -A

# Services
kubectl get svc -A

# HTTPRoutes
kubectl get httproutes -A

Common Issues

  • CrashLoopBackOff: Check logs, resource limits, configuration
  • ImagePullBackOff: Check registry auth, image name
  • Pending: Check resource requests, node capacity
  • Evicted: Check disk pressure, memory limits