()
| 5 | |
| 6 | |
| 7 | async 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 | |
| 24 | if __name__ == "__main__": |
no test coverage detected