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

A better way to specify the JSON path is:

kubectl get pods -n kube-system --sort-by='{.metadata.creationTimestamp}'

There’s a longer note on Kubernetes over here.

I use this when debugging rollout issues — seeing pods in chronological order makes it obvious which ones are new and which are leftover from a previous deployment. The JSON path syntax with curly braces is more explicit and works consistently across kubectl versions. You can sort by any field in the pod spec, not just creation time — .status.startTime or .metadata.name are also useful. Combine it with -o wide to see node assignments alongside the timestamps.