We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5521d84 commit 987cda1Copy full SHA for 987cda1
examples/in_cluster_config.py
@@ -0,0 +1,18 @@
1
+# Simple example to show loading config from the cluster
2
+
3
+from kubernetes import client, config
4
5
6
+def main():
7
+ config.load_incluster_config()
8
9
+ v1 = client.CoreV1Api()
10
+ print("Listing pods with their IPs:")
11
+ ret = v1.list_pod_for_all_namespaces(watch=False)
12
+ for i in ret.items:
13
+ print("%s\t%s\t%s" %
14
+ (i.status.pod_ip, i.metadata.namespace, i.metadata.name))
15
16
17
+if __name__ == '__main__':
18
+ main()
0 commit comments