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
Watch Timeouts
Watch timesout after 5 minutes, after which kubectl will re-establish the watch and print the resources.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
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified September 30, 2020: SIG CLI docs - guide changes (d705a6d)