etcdctl watch
kubectl watch¶
etcdctl watch --help
NAME:
watch - Watches events stream on keys or prefixes
USAGE:
etcdctl watch [options] [key or prefix] [range_end] [--] [exec-command arg1 arg2 ...] [flags]
OPTIONS:
-h, --help[=false] 输出 watch 的帮助信息
-i, --interactive[=false] 交互模式,需要在交互窗口中输出 watch 和 key
--prefix[=false] 前缀匹配,显示所有前缀符合的 key
--prev-kv[=false] get the previous key-value pair before the event happens
--rev=0 Revision to start watching
watch 监测一个键值的变化,一旦键值发生更新,就会输出最新的值并退出。
例如,用户更新 testkey 键值为 Hello world。