I want to know how to get events which are running on a specific node.
In my case my k8s cluster is made up of 3 worker nodes (node1,node2,node3). I want to get a list of all the events that are getting executed on node2.
I know i can get namespace specific events by: kubectl get event --namespace default
Is there a way/option to get something like: kubectl get event --nodename node2
This is what works
$ kubectl get events --all-namespaces -o wide | grep -i node01
To get all k8s events
kubectl get events -A
To filter events for only a specific object. Object can be podname, nodename, etc.
kubectl get events --field-selector involvedObject.name=nodename -A
Above filter based command is more helpful then obtaining all events and then doing grep for a specific node because in this command we can just add -w and then it will work for watching filtered event for that object
kubectl get events --field-selector involvedObject.name=node.name.com -A -w
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With