Retrieve full name Kubernetes Pods
1 min read

Retrieve full name Kubernetes Pods

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