<p>Kubernetes Controllers / Operators are one of the patterns to develop Kubernetes applications. One of the core Kubernetes processes that run is the controller reconciliation loop. </p>

<p>I would like to know what is the default time interval the recon loop is called or triggered?</p>

<p>Is it possible to modify this interval to trigger the recon loop if there are no events captured by the controller?</p>

subodev
<p>The answer here is: it really depends on the controller. For example, if you see the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/" rel="nofollow noreferrer">kube-controller-manager options</a> you'll see that the single binary includes all these controllers:</p>

<pre><code>attachdetach, bootstrapsigner, cloud-node-lifecycle, clusterrole-aggregation, cronjob, csrapproving, csrcleaner, csrsigning, daemonset, deployment, disruption, endpoint, garbagecollector, horizontalpodautoscaling, job, namespace, nodeipam, nodelifecycle, persistentvolume-binder, persistentvolume-expander, podgc, pv-protection, pvc-protection, replicaset, replicationcontroller, resourcequota, root-ca-cert-publisher, route, service, serviceaccount, serviceaccount-token, statefulset, tokencleaner, ttl, ttl-after-finished
</code></pre>

<p>Some of them have configurable sync periods and some don't (Built into the controller). For example for Deployments:</p>

<pre><code>--deployment-controller-sync-period duration     Default: 30s
</code></pre>

<p>As you may be aware, the way the sync process works is first the controller listens to informers then if there's an update on an informer the controller puts the update in a work queue, then the sync process kicks in every so often. In <a href="https://github.com/kubernetes/sample-controller/blob/master/controller.go#L150" rel="nofollow noreferrer">this example</a>,  a sample controller, that time is determined by the second parameter of this <a href="https://github.com/kubernetes/sample-controller/blob/master/controller.go#L166" rel="nofollow noreferrer">call</a>:</p>

<pre><code>// time.Second means 1 second
go wait.Until(c.runWorker, time.Second, stopCh)
</code></pre>

<p><code>Until</code> is an api-machinery function described <a href="https://godoc.org/k8s.io/apimachinery/pkg/util/wait#Until" rel="nofollow noreferrer">here</a>.</p>

<p>Keep in mind that the example has a threadiness of <a href="https://godoc.org/k8s.io/apimachinery/pkg/util/wait#Until" rel="nofollow noreferrer">2</a>, meaning that two sync operations can happen at the same time.</p>
