+python test
This commit is contained in:
parent
e2520ce826
commit
3d730a0e9c
1 changed files with 9 additions and 0 deletions
9
python/test.py
Normal file
9
python/test.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from kubernetes import client, config
|
||||
|
||||
config.load_kube_config()
|
||||
|
||||
v1=client.CoreV1Api()
|
||||
print("Listing pods with their IPs:")
|
||||
ret = v1.list_pod_for_all_namespaces(watch=False)
|
||||
for i in ret.items:
|
||||
print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name))
|
Loading…
Reference in a new issue