コード例 #1
0
async def watch_resource(resource, **kwargs):
    # Consume and print the events as they stream in from the `resource`
    async for event in k8s.Watch(resource, **kwargs):
        print(f"{event.name} {event.obj.kind} {event.obj.metadata.name}")
コード例 #2
0
async def watch_resource(cluster_name, resource, **kwargs):
    async for event in k8s.Watch(resource, **kwargs):
        print(f"{event.name} {event.obj.kind} {event.obj.metadata.name}")