Get Kubernetes events according to date using kubectl

How to get Kubernetes events according to date using kubectl

In this tutorial, I will show you how to get the Kubernetes events according to date using kubectl. Most of the time we want to get the events in k8s but they are not sorted according to the date and time. So, we sort the events according to creation timestamp

Read Also: Kubectl cheat sheet

Get Kubernetes events

So let’s see how we can do that. First of all, let’s get the events.

kubectl get events -n monitoring

The above command will show you the events from the monitoring namespace.

Read Also: Kubernetes get pods on a Specific Node

kubectl get events --sort-by=.metadata.creationTimestamp -A

The above command will show all the events from all the namespaces with the timestamp. It’s really easy to see the sorted events.

Please let me know how you liked the article. For more articles like this please comment below.

 

Leave a Reply

Your email address will not be published.


*


Secured By miniOrange