Commits (2)
......@@ -81,6 +81,10 @@ var (
ingressClassF = flag.String("class", "varnish", "value of the Ingress "+
"annotation kubernetes.io/ingress.class\nthe controller only "+
"considers Ingresses with this value for the\nannotation")
resyncPeriodF = flag.Duration("resyncPeriod", 30*time.Second,
"if non-zero, re-update the controller with the state of\n"+
"the cluster this often, even if nothing has changed,\n"+
"to synchronize state that may have been missed")
logFormat = logrus.TextFormatter{
DisableColors: true,
FullTimestamp: true,
......@@ -93,10 +97,6 @@ var (
informerStop = make(chan struct{})
const resyncPeriod = 0
// resyncPeriod = 30 * time.Second
// Satisifes type TweakListOptionsFunc in
// k8s.io/client-go/informers/internalinterfaces, for use in
// NewFilteredSharedInformerFactory below.
......@@ -177,20 +177,20 @@ func main() {
var vcrInformerFactory vcr_informers.SharedInformerFactory
if *namespaceF == api_v1.NamespaceAll {
informerFactory = informers.NewSharedInformerFactory(
kubeClient, resyncPeriod)
kubeClient, *resyncPeriodF)
vcrInformerFactory = vcr_informers.NewSharedInformerFactory(
vingClient, resyncPeriod)
vingClient, *resyncPeriodF)
} else {
informerFactory = informers.NewFilteredSharedInformerFactory(
kubeClient, resyncPeriod, *namespaceF, noop)
kubeClient, *resyncPeriodF, *namespaceF, noop)
vcrInformerFactory =
vingClient, resyncPeriod, *namespaceF, noop)
vingClient, *resyncPeriodF, *namespaceF, noop)
// XXX this is prefered, but only available in newer
// versions of client-go.
// informerFactory = informers.NewSharedInformerFactoryWithOptions(
// kubeClient, resyncPeriod,
// kubeClient, *resyncPeriodF,
// informers.WithNamespace(*namespaceF))
......@@ -38,6 +38,10 @@ Usage of ./k8s-ingress:
-readyfile string
path of a file to touch when the controller is ready,
for readiness probes
-resyncPeriod duration
if non-zero, re-update the controller with the state of
the cluster this often, even if nothing has changed,
to synchronize state that may have been missed (default 30s)
-stderrthreshold value
logs at or above this threshold go to stderr
-templatedir string
......@@ -105,6 +109,15 @@ deactivated for values <= 0. The monitor sleeps this long between
monitor runs for Varnish Services. See the documentation at the link
for more details.
``-resyncPeriod`` determines how often the controller is re-updated
with the state of the cluster. On this interval, the controller
receives Update events for all of the relevant resources in the
cluster, even if nothing has changed. This makes it possible to update
the state of Varnish Services, even if an earlier event was missed or
incorrectly interpreted for some reason. By default 30 seconds, and
there is no resync if set to 0s -- then the controller is only
notified when something changes.
``-metricsport`` (default 8080) sets the port number at which the
controller listens for the HTTP endpoint ``/metrics`` to publish
[metrics](/docs/ref-metrics.md) that are suitable for integration with