Kubernetes Logs Skill
Retrieve and analyze logs from Kubernetes pods to understand application behavior and troubleshoot issues.
When to Use This Skill
- •Need to view pod logs
- •Searching for specific error messages
- •Analyzing application behavior
- •Debugging intercontainer communication
- •Following log streams in real-time
Steps
- •Get recent logs —
kubectl logs {pod-name} --tail=50 - •Get all logs —
kubectl logs {pod-name} --all-containers=true - •Search logs —
kubectl logs {pod-name} | grep ERROR - •Follow logs —
kubectl logs {pod-name} -f - •Get previous logs —
kubectl logs {pod-name} --previous