title: SharedIndexInformer (Fabric8 kubernetes-client) watches only pods of its own namespace when run in the cluster
body: <p>I am trying to build a Kubernetes controller using the excellent Fabric8 Kubernetes client for Java (<a href="https://github.com/fabric8io/kubernetes-client" rel="nofollow noreferrer">https://github.com/fabric8io/kubernetes-client</a>). As of now I use the version <code>4.10.3</code>.</p>
  <p>For that purpose I am constructing a <code>SharedIndexInformer</code> to properly watch resources events emitted by the cluster. I will take pods as resources example here.</p>
  <p>So the <code>SharedIndexInformer</code> is constructed following this piece of code:</p>
  <pre class="lang-java prettyprint-override"><code>SharedIndexInformer&lt;Pod&gt; sharedIndexInformer = kubernetesClient.informers().sharedIndexInformerFor(
                  objectClass,
                  objectClassList,
                  10 * 60 * 1000);
  </code></pre>
  <p>Following, lot of code to attach events handler, start the indexer, have a reconciliation loop and so on.</p>
  <p>The indexer is working perfectly fine when started from my local machine, and I see all pods being listed. However, when I run it on a pod in my cluster (with RBAC properly defined), I see only the pods for the namespace where the pod is run on.</p>
  <p>I checked explicitly in the pod that, using <code>kubectl</code>, the associated service account was capable to list all pods in the cluster, and not only in the current namespace.</p>
  <p>What am I missing?</p>
  <p>Thanks in advance for your help!</p>