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

k8s.io/client-go informer library #14

Closed
ideahitme opened this issue Feb 15, 2017 · 9 comments
Closed

k8s.io/client-go informer library #14

ideahitme opened this issue Feb 15, 2017 · 9 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Milestone

Comments

@ideahitme
Copy link

As suggested by @linki it might make sense to checkout the client-go informer library to fetch/watch the list of services/ingress resources. A pretty clean example can be found here:

https://github.com/wfarr/client-go/blob/577d1900c3ba12335dc1edb4a812c14a07effd73/examples/informer/main.go

It is currently used in main kuberentes repo and in few of the /contrib projects as well

@ideahitme
Copy link
Author

additionally there is a workqueue which helps to create a controller synchronized with a certain k8s resource state. Example: https://github.com/kubernetes/client-go/pull/65/files

@linki
Copy link
Member

linki commented Feb 15, 2017

Thanks @ideahitme.

This is also a very valuable document: Writing Controllers

@ideahitme ideahitme changed the title Client-go informer library k8s.io/client-go informer library Feb 15, 2017
@justinsb
Copy link
Contributor

justinsb commented Feb 27, 2017

We also could import the kops code e.g. https://github.com/kubernetes/kops/blob/master/dns-controller/pkg/watchers/servicecontroller.go

The abstractions are not necessarily any easier to understand, in my experience.

The top bug that everyone falls in to is start reading the results in, and not waiting until the List has completed before processing. So on a restart, you delete almost all the records, then repopulate them as the List proceeds.

The kops dns-controller builds an in-memory desired state of the world (https://github.com/kubernetes/kops/blob/master/dns-controller/pkg/dns/dnscontext.go), and then keeps tracks of which records are dirty. It then polls this for dirty records every N seconds, which gives us some change debouncing. Polling for dirty records is efficient, particularly in the "nothing changed" case.

@linki linki modified the milestones: post-v1.0, v1.0 Apr 3, 2017
@linki
Copy link
Member

linki commented Aug 18, 2017

Joe Beda built another template for how a controller should look: https://github.com/jbeda/tgik-controller

@prydie
Copy link
Contributor

prydie commented May 9, 2018

Our use-case for external-dns has latency requirements that the current reconciliation loop implementation isn’t ideally suited to. I’d be interested in picking this up if its still the direction the project wants to go in?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

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

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-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 May 23, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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.

lou-lan pushed a commit to lou-lan/external-dns that referenced this issue May 11, 2022
…s-sigs#14)

* krew info: Improve error message when plugin doesn't exist

* fixup! krew info: Improve error message when plugin doesn't exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants