a guest Apr 21st, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from kubernetes import client, config, watch
- def main():
- # Configs can be set in Configuration class directly or using helper
- # utility. If no argument provided, the config will be loaded from
- # default location.
- v1 = client.CoreV1Api()
- count = 10
- w = watch.Watch()
- for event in w.stream(v1.list_namespace, timeout_seconds=10):
- print("Event: %s %s" % (event['type'], event['object'].metadata.name))
- count -= 1
- if not count:
- if __name__ == '__main__':
RAW Paste Data