Update app.py

This commit is contained in:
Matthew Fisher 2024-08-18 11:32:12 -05:00
parent 5ebc722bb6
commit 9fbae0c3b3

10
app.py
View File

@ -0,0 +1,10 @@
from kubernetes import client, config
# Configs can be set in Configuration class directly or using helper utility
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))