<p>I have a controller which Reconciles MyKind Custom Resource in 'foo' namespace. Within the reconcile loop, it creates a deployment MyDeployment in 'bar' namespace. I am wondering how can I setup a watch on the MyDeployment created in 'bar' namespace which is different than namespace ('foo') where the custom resource live.</p>
<p>I tried setting up my manager with the following, but it doesnt seem to work since the deployment I am trying to watch are in different namespace hence the controller is not able to receive any events for the CRUD operation on the deployment.</p>
<pre><code>    return controllerruntime.NewControllerManagedBy(mgr).
        For(&amp;v1alpha1.MyKind{}).
        Owns(&amp;appsv1.Deployment{}).
        Complete(r)
}
</code></pre>
<p>Is there any custom watch that I can configure my controller with in order to receive events for the deployment in a different namespace.</p>
<p>Note: I tried handler.EnqueueRequestsFromMapFunc, IIUC it also reconciles for Kinds in the same namespace.</p>

Kapoor Akul
<p>You can specify namespaces in the manager options by passing in a <code>ctrl.Options{}</code> object, while creating it.</p>
<pre><code>namespace := &quot;namespace1,namespace2&quot;
options := ctrl.Options{
        .
        .
        .
        Namespace: cache.MultiNamespacedCacheBuilder(strings.Split(namespace, &quot;,&quot;))
    }

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), options)
</code></pre>
