kubectl get tables show a handful of columns. The object behind them has hundreds of fields, and -o yaml dumps all of them. JSONPath picks the ones you want.
One field
kubectl get pod market-api-7b6c-x2k4p -o jsonpath='{.spec.containers[0].image}'
kubectl get deploy market-api -o jsonpath='{.status.readyReplicas}'The expression walks the object the way -o yaml shows it: .spec, then .containers, index 0, then .image. The whole thing sits in single quotes so the shell does not touch the braces, brackets and asterisks.
Many objects
A get without a name returns a list, and the objects are under .items:
kubectl get pods -o jsonpath='{.items[*].metadata.name}'market-api-7b6c-x2k4p market-db-5f7d-m2k8q market-web-6d9f-q8r1z[*] takes every element. The output is one line, space-separated, because JSONPath prints only what you ask for.
Loops
kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'market-api-7b6c-x2k4p 10.42.0.12
market-db-5f7d-m2k8q 10.42.0.14
market-web-6d9f-q8r1z 10.42.0.9range … end runs the template once per element. Literal text goes in double quotes inside the braces: {"\t"} and {"\n"} are how you get columns and lines.
Filters
kubectl get nodes -o jsonpath='{.items[*].status.conditions[?(@.type=="Ready")].status}'
kubectl get pods -o jsonpath='{.items[?(@.status.phase=="Running")].metadata.name}'[?(@.field=="value")] keeps the elements whose field matches. @ is the current element. It is the way to read one condition out of a list of conditions, or to select Pods by a status field the table does not show.