How do you stream only warning/error events across all namespaces with kubectl?
⚡
Quick Answer
Watch events cluster-wide and filter out the Normal type, so only warnings and failures show up live — great for catching scheduling failures, image pull errors, and OOM kills as they happen.
Detailed Answer
kubectl get events surfaces the cluster running commentary; -A spans all namespaces, -w streams updates, and dropping Normal leaves only actionable signals. For a cleaner feed, kubectl get events -A --field-selector type=Warning -w filters server-side instead of with grep.
Code Example
kubectl get events -A -w | grep -v Normal # or, server-side filtered: kubectl get events -A --field-selector type=Warning -w
💡
Interview Tip
Bonus: mention --field-selector type=Warning as the server-side alternative to grep — cleaner and less load on the API server.
kuberneteskubectleventstroubleshooting