简体   繁体   English

如何使用kube.netes python客户端获取pod所在节点?

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

I have a Pod name and I want to know where the Pod is located using kube.netes python client.我有一个 Pod 名称,我想使用 kube.netes python 客户端知道 Pod 的位置。 Is it possible to use kube.netes python client in order to get the node name by Pod?是否可以使用 kube.netes python 客户端来通过 Pod 获取节点名称? (Just like the NODE column in kubectl get pod -o wide ) (就像kubectl get pod -o wide中的 NODE 列一样)

I've referred to the document https://github.com/kube.netes-client/python/blob/master/kube.netes/README.md .我参考了文档https://github.com/kube.netes-client/python/blob/master/kube.netes/README.md But I didn't find a solution.但是我没有找到解决办法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在python中使用kubernetes-client lib获取节点的内存 - How can I get node's memory with kubernetes-client lib in python 如何使用python找到单词在句子中的位置? - How can I find where a word is located in a sentence using python? 使用 Python Client API 获取 Kube.netes 节点状态 - Get Kubernetes node status using Python Client API Python kubernetes 客户端获取 pod Ready 状态时间 - Python kubernetes client Get pod Ready state time 如何在 Kubernetes 的 Pod 中分别连接 Python 服务器和 Python 客户端? - How to connect a Python server and Python client each in their pod on Kubernetes? 使用 kubernetes python 客户端将文件从 pod 复制到主机 - Copy file from pod to host by using kubernetes python client Kubernetes pod exec 使用 python 客户端不是很有交互性 - Kubernetes pod exec using python client not very interactive 如何使用 python kubernetes api 通过标签获取 pod? - How can I get pods by label, using the python kubernetes api? 使用 kubernetes 客户端在 pod 上运行脚本并退出 - Using kubernetes client to run a script on pod and get outout 如何登录到 kubernetes pod 并使用 python 脚本在其中编辑 yaml 文件? - How do I login to a kubernetes pod and edit a yaml file inside it using a python script?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM