What You Will Learn
Intermediate
- How to read K8s events
- Useful debugging tools
- k9s and kubectl-debug
Terminalbash
# View cluster events
kubectl get events --sort-by='.lastTimestamp'
# Events for a specific Pod
kubectl get events --field-selector involvedObject.name=my-pod
# Events in a namespace
kubectl get events -n productionUseful Debugging Tools
| Tool | What it does |
|---|---|
k9s | TUI for K8s - navigate everything interactively |
kubectl-debug | Attach a debug container to a Pod |
stern | Tail logs from multiple Pods at once |
kubectx | Switch between clusters/namespaces quickly |
kube-shell | Enhanced kubectl shell with autocomplete |
Practical Exercise
Run: kubectl get events --sort-by='.lastTimestamp'
Run: kubectl describe pod - read Events section
Install k9s: brew install k9s (amazing TUI tool)
Run k9s and explore your cluster interactively
Key Takeaways
- kubectl get events: see what K8s is doing.
- Events sorted by time show the timeline of issues.
- k9s: TUI for navigating K8s (highly recommended).
- stern: tail logs from multiple Pods simultaneously.
- kubectl describe: Events section is at the bottom.
Comments
Comments
Post a Comment