Skip to content

A simple service to trigger a handler when WATCHER_WATCHED_FILE is updated.

Notifications You must be signed in to change notification settings

chilianyi/watcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Watcher

Build Status Docker Build Status License


watcher is a simple service to trigger a handler when WATCHER_WATCHED_FILE is updated.

In openpitrix, the global config is load into ConfigMap when depolied by helm or kubernetes; watcher watches mounted volume dirs from ConfigMap and notifies the target process(UpdateOpenPitrixEtcd) that the config map has been changed. It currently only supports handler UpdateOpenPitrixEtcd.


Usage

Local

$ export WATCHER_HANDLER=UpdateOpenPitrixEtcd \
  WATCHER_WATCHED_FILE=./test/global_config.yaml \
  WATCHER_DURATION=10 \
  WATCHER_LOG_LEVEL=debug \
  WATCHER_ETCD_PREFIX=openpitrix \
  WATCHER_ETCD_ENDPOINTS=127.0.0.1:2379 \
  IGNORE_KEYS='{"runtime": true, "cluster": {"registry_mirror": true}}'

$ cd watcher
$ go run cmd/watcher/main.go

Docker

docker run -it -d \
       -v ${CONFIG_DIR}:/opt/config.yaml \
       -e WATCHER_HANDLER=UpdateOpenPitrixEtcd \
       -e WATCHER_WATCHED_FILE=/opt/config.yaml \
       -e WATCHER_DURATION=10 \
       -e WATCHER_LOG_LEVEL=debug \
       -e WATCHER_ETCD_PREFIX=openpitrix \
       -e WATCHER_ETCD_ENDPOINTS=127.0.0.1:2379 \
       -e IGNORE_KEYS='{"runtime": true, "cluster": {"registry_mirror": true}}' \
       --name watcher openpitrix.io/watcher

Helm

refrence: https://github.com/openpitrix/helm-chart

About

A simple service to trigger a handler when WATCHER_WATCHED_FILE is updated.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published