Commit d1541688 authored by Geoff Simmons's avatar Geoff Simmons

The monitor is deactivated when monitorintvl <= 0s.

parent 6af04dd6
...@@ -73,7 +73,8 @@ var ( ...@@ -73,7 +73,8 @@ var (
"when the controller is ready,\nfor readiness probes") "when the controller is ready,\nfor readiness probes")
monIntvlF = flag.Duration("monitorintvl", 30*time.Second, monIntvlF = flag.Duration("monitorintvl", 30*time.Second,
"interval at which the monitor thread checks and updates\n"+ "interval at which the monitor thread checks and updates\n"+
"instances of Varnish deployed to implement Ingress") "instances of Varnish that implement Ingress.\n"+
"Monitor deactivated when <= 0s")
logFormat = logrus.TextFormatter{ logFormat = logrus.TextFormatter{
DisableColors: true, DisableColors: true,
FullTimestamp: true, FullTimestamp: true,
......
...@@ -25,7 +25,8 @@ Usage of ./k8s-ingress: ...@@ -25,7 +25,8 @@ Usage of ./k8s-ingress:
cluster master URL, for out-of-cluster runs cluster master URL, for out-of-cluster runs
-monitorintvl duration -monitorintvl duration
interval at which the monitor thread checks and updates interval at which the monitor thread checks and updates
instances of Varnish deployed to implement Ingress (default 30s) instances of Varnish that implement Ingress.
Monitor deactivated when <= 0s (default 30s)
-namespace string -namespace string
namespace in which to listen for resources (default all) namespace in which to listen for resources (default all)
-readyfile string -readyfile string
...@@ -81,9 +82,10 @@ touches it when it is ready. Readiness probes can then test the file ...@@ -81,9 +82,10 @@ touches it when it is ready. Readiness probes can then test the file
for existence. By default, no readiness file is created. for existence. By default, no readiness file is created.
``-monitorintvl`` sets the interval for the ``-monitorintvl`` sets the interval for the
[monitor](/docs/monitor.md), default 30 seconds. The monitor sleeps [monitor](/docs/monitor.md). By default 30 seconds, and the monitor is
this long between monitor runs for Varnish Services. See the deactivated for values <= 0. The monitor sleeps this long between
documentation at the link for more details. monitor runs for Varnish Services. See the documentation at the link
for more details.
``-log-level`` sets the log level for the main controller code, ``-log-level`` sets the log level for the main controller code,
``INFO`` by default. ``INFO`` by default.
......
...@@ -147,6 +147,11 @@ func (vc *VarnishController) checkInst(svc string, inst *varnishInst) bool { ...@@ -147,6 +147,11 @@ func (vc *VarnishController) checkInst(svc string, inst *varnishInst) bool {
} }
func (vc *VarnishController) monitor(monitorIntvl time.Duration) { func (vc *VarnishController) monitor(monitorIntvl time.Duration) {
if monitorIntvl <= 0 {
vc.log.Infof("Varnish monitor interval=%v, monitor not running",
monitorIntvl)
return
}
vc.log.Info("Varnish monitor starting, interval: ", monitorIntvl) vc.log.Info("Varnish monitor starting, interval: ", monitorIntvl)
for { for {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment