ungleich-k8s/archive/v3/tests/python/test.py
2021-10-18 15:15:52 +02:00

9 lines
279 B
Python

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))