Skip to content

How to Sort Pods by CreationTimestamp in Kubernetes

If you need to sort a list of your pods by their CreationTimestamp, then do the following:

kubectl get pods -n kube-system --sort-by=metadata.creationTimestamp
Code language: Bash (bash)

A better way to specify the JSON path is:

kubectl get pods -n kube-system --sort-by='{.metadata.creationTimestamp}'
Code language: Bash (bash)

See also  How to create an AWS EC2 instance in CloudFormation
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x