etcd is a distributed, highly available key-value store which serves as the persistent back end for Kubernetes
Here is an example to demonstrate its Watch
feature. For details, check out the README (and the sample code) on Github
It uses
- etcd Docker image
- etcd Go client
Summary
- a watch is set, and …
- … the channel is used to listen to events
- a separate goroutine is spawned to trigger key modification which in turn generates events
Cheers!