get name and image and startTime
kubectl get pods -Ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@..spec..containers[*].image}{" "}{@.status.phase}{" "}{@.status.startTime}{"\n"}{end}'
edited 10/2022 with ..
and A
suggestions
get name and image and startTime
kubectl get pods -Ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@..spec..containers[*].image}{" "}{@.status.phase}{" "}{@.status.startTime}{"\n"}{end}'
edited 10/2022 with ..
and A
suggestions
nice. thanks!
{@..containers..image}
Thank you . this helped in fetching multiple fields in a big json groupwise ..
For new versions kubectl, you'd like to use
-Ao
instead.Use
..
to search some deep nested keys andcolumn -t
for alignment:kubectl get pods -o jsonpath='{range .items[*]}{@.metadata.name}{" "}{@..containers.image}{" "}{@.status.phase}{" "}{@..startTime}{"\n"}{end}' | column -t