Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedIndexInformer watches only pods of its own namespace when run in the cluster #2527

Closed
adferrand opened this issue Oct 5, 2020 · 2 comments · Fixed by #2536
Closed
Labels

Comments

@adferrand
Copy link

adferrand commented Oct 5, 2020

I am trying to build a Kubernetes controller using fabric8io/kubernetes-client. As of now I use the version 4.10.3.

For that purpose I am constructing a SharedIndexInformer to properly watch resources events emitted by the cluster. I will take pods as resources example here.

So the SharedIndexInformer is constructed following this piece of code:

SharedIndexInformer<Pod> sharedIndexInformer = kubernetesClient.informers().sharedIndexInformerFor(
                objectClass,
                objectClassList,
                10 * 60 * 1000);

Following, lot of code to attach events handler, start the indexer, have a reconciliation loop and so on.

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.

I checked explicitly in the pod that, using kubectl, the associated service account was capable to list all pods in the cluster, and not only in the current namespace.

What am I missing?

Thanks in advance for your help!

@manusa manusa added the question label Oct 5, 2020
@adferrand
Copy link
Author

I close the issue here to avoid duplicate with the question I also submit on StackOverflow: https://stackoverflow.com/questions/64204044/sharedindexinformer-fabric8-kubernetes-client-watches-only-pods-of-its-own-nam

@rohanKanojia
Copy link
Member

oh, I'm sorry. I didn't see your issue. This is also related to #2514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants