-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cache selectors should allow setting a default #1708
Comments
I definitely agree that a default selector would be useful in many cases (e.g. label If I'm understanding this correctly, it would result in the informers using a cluster-wide list/watch and the apiserver receiving all objects from etcd before filtering down to the desired namespace. Clients using this setup would require cluster-wide RBAC list/watch for all of the watched kinds and (barring any gaps in my understanding of apiserver <-> etcd communication) would cause unnecessary resource usage from objects not in the selected namespaces being unnecessarily sent from etcd to the apiserver. It seems like the |
No, the selector can be used to not even receive the objects and make the apiserver filter for us. Using a default namespace was just an example btw, could also be a default label selector. What exactly makes sense depends on what you want to do :) |
Understood, but if Nonetheless, I agree a default selector is valuable. |
No, we had a change a while back that made us do a namespace-scoped list+watch request and only requires rbac for that namespace if a fieldselector for a namespace is set: #1602 |
Ah ha! That was the piece I was missing. Very cool! |
This gives us flexibility to cache only exactly what we need. The error that led me to this was that we were attempting to Watch() Routes/Ingresses which is basically caching all namespaces. We only want to cache the CDI namespace for those. Source/feature from kubernetes-sigs/controller-runtime#1708 Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
This gives us flexibility to cache only exactly what we need. The error that led me to this was that we were attempting to Watch() Routes/Ingresses which is basically caching all namespaces. We only want to cache the CDI namespace for those. Source/feature from kubernetes-sigs/controller-runtime#1708 Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
…2371) * Only list Ingresses/Routes in CDI namespace instead of cluster level Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com> * Change the way we initialize cache for cdi controller This gives us flexibility to cache only exactly what we need. The error that led me to this was that we were attempting to Watch() Routes/Ingresses which is basically caching all namespaces. We only want to cache the CDI namespace for those. Source/feature from kubernetes-sigs/controller-runtime#1708 Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
It is currently possible to set a selector in the cache per GVK, however it is not possible to set a default selector which might be very useful for scenarios like "I want all caches in this namespace except the cache for footype, which should be in a different namespace".
The text was updated successfully, but these errors were encountered: