Client-go: How to get the node on which a pod is running?

Created on 19 Apr 2018  路  2Comments  路  Source: kubernetes/client-go

kubectl get pods -o wide returns a NODES column that shows where each pod is running. Given a pod name, how can I get the corresponding node name? I couldn't find a way to get it from v1.Pod.

Most helpful comment

kubectl get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespaces

All 2 comments

mark i also have this problem

kubectl get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespaces

Was this page helpful?
0 / 5 - 0 ratings

Related issues

protheusfr picture protheusfr  路  3Comments

strugglingyouth picture strugglingyouth  路  5Comments

yashbhutwala picture yashbhutwala  路  4Comments

mheese picture mheese  路  5Comments

gtaylor picture gtaylor  路  6Comments