Closed nkvoll closed 3 years ago
1435 is now merged, so is this resolved?
@invidian yes I believe this is resolved.
/close
@estroz: Closing this issue.
It seems like the current solution doesn't address the use case mentioned in https://github.com/kubernetes-sigs/controller-runtime/issues/244#issuecomment-557656216.
It should be possible to create a namespace scoped client in ListFunc and WatchFunc if there is a field selector for metadata.namespace
(vs the current logic of just looking at the global namespace field). Is that reasonable?
@roee88 what was merged allows to set a FieldSelector so yes, this is possible
To clarify, I suspect that without affecting the parameters to NamespaceIfScoped, the selector opts have no effect on the required rbac (cluster role bindings vs role bindings). For example here:
My question is whether changing the code here makes sense. Specifically for the case where ip.namespace is empty, the value from a metadata.namespace
field selector should be used (if exists).
cc @shlomitk1
My question is whether changing the code here makes sense. Specifically for the case where ip.namespace is empty, the value from a metadata.namespace field selector should be used (if exists).
That sounds reasonable
When setting up watches during initialization it's currently not possible to filter by any selectors (which is possible using list watches).
For example it is not possible to only watch pods with specific labels (e.g having the label
pod-type: my-controller-type
). The current behavior results in very broad caching, which might not be desirable for large Kubernetes deployments.In some scenarios an operator could contain multiple controllers, and they all share caches, so keying caches on GVK's alone might be problematic if they want to watch the same resource type, but with different filters.
When doing
List
/Get
, how would one decide which of the caches to use? It seems that perhaps this needs to be an explicit choice by the operator developers?