Created
September 2, 2024 17:14
-
-
Save langheran/85258e8a44a73a297fc7f3b23ecbdabc to your computer and use it in GitHub Desktop.
C:\Users\NisimHurst\NDS\scripts\monitor_kubectl.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kubernetes import client, config, watch | |
config.load_kube_config() | |
v1 = client.CoreV1Api() | |
w = watch.Watch() | |
for event in w.stream(v1.list_namespaced_pod, namespace='default'): | |
print(f"Event: {event['type']} - Pod: {event['object'].metadata.name}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment