watch

Watching for Object Changes

Continuously Watch and print Resources as they change

Print Resources as they are updated.

It is possible to have kubectl get continuously watch for changes to objects, and print the objects when they are changed or when the watch is reestablished.

Command

kubectl get deployments --watch

Output

NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
nginx     1         1         1            1           6h
nginx2    1         1         1            1           21m

It is possible to have kubectl get continuously watch for changes to objects without fetching them first using the --watch-only flag.

Command

kubectl get deployments --watch-only

Last modified September 30, 2020: SIG CLI docs - guide changes (d705a6d)