Debugging with kubectl¶
Overview¶
kubectl provides several commands that help diagnose problems in Kubernetes clusters.
These commands allow users to inspect resource status, view logs, and interact with running containers.
Inspect Cluster Resources¶
List cluster resources:
List nodes:
List services:
Inspect Resource Details
View detailed information:
This command shows:
- container configuration
- events
- resource usage
- scheduling information
View Logs
Inspect container logs:
Stream logs in real time:
Run Commands Inside Containers
Open a shell:
Run a command:
View Cluster EventsCheck recent cluster events:
Events can reveal scheduling failures, image pull issues, and container crashes.
Related Documentation
- CrashLoopBackOff
- ImagePullBackOff
- Pod scheduling issues