NightWatch is a tool to monitor docker images deployed in a kubernetes cluster and track for new tags released in the registry.
An all-in-one docker image is released including these components:
Daemon
: is the job that watches every hour in the kubernetes cluster for images and in the registry for new tags.API
: is an http endpoint exposing both: daemon lifecycle related actions and a REST CRUD api. An OpenApi / Swagger doc is also exposed (route:/api/v1/
)Metrics
: exposes prometheus metrics at OpenMetrics format (route:/metrics
)WebUI
: is a simple web console (route:/
)
For now, only docker.io
and quay.io
registries are supported.
The simplest way to start is to chose the in-cluster deployment strategy:
- Clone this repo:
git clone git@github.com:edevouge/nightwatch.git
- Edit the example of kubernetes yaml manifests to match your environnement requirements
- Apply manifests to your kubernetes cluster:
kubectl apply -f ./nightwatch/kubernetes/
- Bind the kubernetes service port to your localhost:
kubectl port-forward -n nightwatch svc/nightwatch 8000:80
- Access the service:
- Webui: http://localhost:8000/
- API doc: http://localhost:8000/api/v1
- Metrics: http://localhost:8000/metrics
As tag names are free text fields in most docker compatible registries, it could be useful to ignore some tags containing strings like: latest
, master
, .*ubuntu
, .*amd
, etc.
NightWatch implements powerful filters to select eligible tags matching a regular expression. These filters could be global
or scoped at registry
or repository
levels.
Default filters could be found here and could be extended using a configmap
like this one.