kubectl get pod web-7d8f9c -o jsonpath={.status.podIP}
Extract a pod IP with jsonpath
Queries a single field from the pod's API object instead of printing the whole thing. JsonPath expressions follow the resource structure, which you can inspect with kubectl explain or kubectl get pod web-7d8f9c -o yaml. Wrap the expression in single quotes when it contains braces.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.