In [ ]:
from kubernetes import client, config, watch
In [ ]:
config.load_kube_config()
In [ ]:
api_instance = client.CoreV1Api()
Watch would be executed and produce output about changes to any Pod. After running the cell below, You can test this by running the Pod notebook create_pod.ipynb and observing the additional output here. You can stop the cell from running by restarting the kernel.
In [ ]:
w = watch.Watch()
for event in w.stream(api_instance.list_pod_for_all_namespaces):
print("Event: %s %s %s" % (event['type'],event['object'].kind, event['object'].metadata.name))
In [ ]: