Skip to content
harry-suryapambagya

Retrieve full name Kubernetes Pods

Retrieve the full name of a Kubernetes pod with kubectl label selectors and a JSONPath query, illustrated with an NGINX pod.

updated 1 min read

Ever try to retrieve the full name of your Kubernetes Pods?

Let's say your pods are running NGINX.

Use a JSON query option like this.

$ kubectl get pods -l app=nginx -o jsonpath="{.items[0].metadata.name}{'\n'}
nginx-85b98978db-kll6q