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

RFE: Watch labels #1808

Closed
squeed opened this issue Aug 9, 2019 · 6 comments
Closed

RFE: Watch labels #1808

squeed opened this issue Aug 9, 2019 · 6 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs discussion

Comments

@squeed
Copy link
Contributor

squeed commented Aug 9, 2019

Feature Request

In #314 / #428, the ability was added to watch by label selector. This is useful if the watch would otherwise cause a lot of unnecessary objects to be kept in cache / sent over the wire. However, with the move to the controller-runtime, it seems that feature was lost.

What I really need for my particular use case is the ability to watch for all configmaps with a specific label, in all namespaces. I'd like to avoid keeping all configmaps in memory.

It may be that this particular use-case is too far outside the scope of a normal operator, in which case that's fine. I still think that label-based watches would be useful :-)

@joelanford
Copy link
Member

I'm not sure if @hasbro17 has any background on this, but this seems do-able as a PR to controller-runtime.

I did my best to trace back from the source.Kind to see how it populates the cache, and it appears that client-go's cache.Reflector is what actually makes the List and Watch() calls to the API using the cache.ListWatch setup by controller-runtime here and here. However controller-runtime currently doesn't expose a way to modify the ListOptions.

Perhaps it would be possible to update source.Kind to use NewFilteredListWatchFromClient() (or some variant of that) and expose optionsModifier as a public field on source.Kind?

@joelanford joelanford self-assigned this Aug 9, 2019
@hasbro17
Copy link
Contributor

hasbro17 commented Aug 9, 2019

@joelanford There's already a feature request for this upstream: kubernetes-sigs/controller-runtime#244

I think the general idea is that we'll want to pass down a predicate to a controller's Watch that would dynamically make the informer's ListWatch filtered.
However that leaves you with the issue of the default cached client now using a filtered cache.
There's some options for dealing with that but that's something we need to figure out upstream with a design proposal/poc.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 7, 2019
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 8, 2019
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci-robot
Copy link

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs discussion
Projects
None yet
Development

No branches or pull requests

5 participants