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
当前内容版权归 kubernetes官网 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 kubernetes官网 .