From 9fbae0c3b3de952b685b8932d47d1aad9b3ed67b Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Sun, 18 Aug 2024 11:32:12 -0500 Subject: [PATCH] Update app.py --- app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.py b/app.py index e69de29..ba63c98 100644 --- a/app.py +++ b/app.py @@ -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)) \ No newline at end of file