Reason into a path

Write a command into “/opt/course/5/find_pods.sh” which lists all Pods sorted by their AGE (metadata.creationTimestamp). How to write into the command into the path??..And how to write reason in “TEXT” format into a path???

Hello Annamalai

Can you please explain more about this question?

Thanks,
KodeKloud Support

If you are asking about how to export the result in json file please use this method

kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.creationTimestamp}{'\n'}{end}"

Thanks
KodeKloud Support