Kubernetes get pods sort by time
In this tutorial, I will show you how to get the kubectl get pods sort by time. Most of the time we want to get the pods in k8s but they are not sorted according to the date and time. So, we sort the kubernetes pods according to date.
Read Also: Get Kubernetes events according to date using kubectl
Read Also: Kubectl cheat sheet
Get kubectl pods sort by time
So let’s see how we can do that. First of all, let’s get pods.
kubectl get pods --sort-by=.metadata.creationTimestamp -n namespace
Pods in all namespaces
kubectl get pods --sort-by=.metadata.creationTimestamp -A
Please let me know if you like the tutorial.
Leave a Reply