MCPcopy Index your code
hub / github.com/kubernetes-client/python / main

Function main

examples_asyncio/list_pods.py:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7async def main():
8 # Configs can be set in Configuration class directly or using helper
9 # utility. If no argument provided, the config will be loaded from
10 # default location.
11 await config.load_kube_config()
12
13 # use the context manager to close http sessions automatically
14 async with ApiClient() as api:
15
16 v1 = client.CoreV1Api(api)
17 print("Listing pods with their IPs:")
18 ret = await v1.list_pod_for_all_namespaces()
19
20 for i in ret.items:
21 print(i.status.pod_ip, i.metadata.namespace, i.metadata.name)
22
23
24if __name__ == "__main__":

Callers 1

list_pods.pyFile · 0.70

Calls 2

ApiClientClass · 0.90

Tested by

no test coverage detected