How can I get the node where the pod is located using kubernetes python client?

Question:

I have a Pod name and I want to know where the Pod is located using kubernetes python client.
Is it possible to use kubernetes python client in order to get the node name by Pod? (Just like the NODE column in kubectl get pod -o wide)

I’ve referred to the document https://github.com/kubernetes-client/python/blob/master/kubernetes/README.md. But I didn’t find a solution.

Asked By: Billy Chen

||

Answers:

Answered By: user2311578
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.