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

Informer framework #4

Closed
sttts opened this issue Sep 10, 2016 · 35 comments · Fixed by kubernetes/kubernetes#33632
Closed

Informer framework #4

sttts opened this issue Sep 10, 2016 · 35 comments · Fixed by kubernetes/kubernetes#33632

Comments

@sttts
Copy link
Contributor

sttts commented Sep 10, 2016

To write third-party controllers having object stores and the informer framework would be very handy.

@sttts sttts changed the title Strores and informer Informer framework Sep 10, 2016
@sttts
Copy link
Contributor Author

sttts commented Sep 10, 2016

@timothysc
Copy link
Member

Many folks would like to refactor or eliminate the current informer entirely.

@deads2k
Copy link
Contributor

deads2k commented Sep 12, 2016

Many folks would like to refactor or eliminate the current informer entirely.

Can you elaborate on this? I know that some people have suggested doing things differently, but what I've seen has only differed in implementation, nothing significant in the API interfaces. I also haven't seen much action on it.

@wojtek-t
Copy link
Member

Yeah - I'm also completely not aware of people that want to remove informer (though we obviously can improve it)

@timothysc
Copy link
Member

timothysc commented Sep 12, 2016

@hongchaodeng and @xiang90 and proposed a refactoring to the informer in the 1.4 cycle that was pushed out. I'd have to dig up the issue number.

s/Eliminate/Choose not to use - Some folks that have designed their own controllers, simply do not use the informer.

@wongma7
Copy link
Contributor

wongma7 commented Sep 14, 2016

Is this the proposal in question? kubernetes/kubernetes#27519

+1 to this anyway, I would rather use the same thing upstream controllers use, whatever flaws it has, than attempt to roll my own

@deads2k
Copy link
Contributor

deads2k commented Sep 14, 2016

Is this the proposal in question? kubernetes/kubernetes#27519

+1 to this anyway, I would rather use the same thing upstream controllers use, whatever flaws it has, than attempt to roll my own

That proposal isn't what kube uses. Kube uses the SharedInformers as they exist today. The proposal didn't interoperate well with the existing DeltaFifo structure that has done a reasonable job so far.

@lavalamp
Copy link
Member

This was an oversight, we intended to include this library, too.

@lavalamp
Copy link
Member

It looks like @mikedanese is moving it anyway, so it should show up soon.

@jimmidyson
Copy link
Member

Any news on this? Chomping at the bit to migrate over to this & really would like the informer framework in place to simplify migration.

@mikedanese
Copy link
Member

kubernetes/kubernetes#32718 Merged. This should hit the 1.5 client once it's synced.

@jimmidyson
Copy link
Member

So this client gets automatically synced from kube repo then? How often does that happen?

@lavalamp
Copy link
Member

~ daily. But I need to approve a PR before the 1.5 client will show up here
:)

On Wed, Sep 21, 2016 at 8:28 AM, Jimmi Dyson notifications@github.com
wrote:

So this client gets automatically synced from kube repo then? How often
does that happen?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnglguclN5PZIetrQUnIovIZdRFiLAIks5qsU06gaJpZM4J5tgT
.

@seh
Copy link

seh commented Sep 25, 2016

If I'm looking to confine my Kubernetes dependencies to this repository, what's a good replacement for workqueue.Interface from "k8s.io/kubernetes/pkg/util/workqueue”?

Type cache.FIFO from “k8s.io/client-go/1.4/tools/cache” is similar, but I don’t see a way to unblock a caller waiting on FIFO.Pop, nor a way to shut the FIFO down. Is there a better choice for replacing workqueue.Interface?

@fabxc
Copy link

fabxc commented Sep 26, 2016

@lavalamp The 1.5/ sub directory is in but it doesn't include Informers. They are neither in the staging path in kubernetes/kubernetes.

Anything we could do to speed this up? It's blocking/complicating some high priority stuff for us.

@caesarxuchao
Copy link
Member

caesarxuchao commented Sep 26, 2016

The informer will show up after kubernetes/kubernetes#33334 gets merged.

We need to manually run staging/src/k8s.io/client-go/copy.sh to populate changes to the staging area, then they will be published to client-go.

@lavalamp
Copy link
Member

@caesarxuchao can we include the workqueue, as well?

@seh
Copy link

seh commented Sep 26, 2016

I've been working today on porting my code that relies on workqueue to use cache.FIFO, with some awkwardness, so if workqueue could come across I'd stick with it.

@lavalamp
Copy link
Member

Yeah, workqueue and cache.FIFO are somewhat different animals-- we should
include workqueue.

On Mon, Sep 26, 2016 at 9:54 AM, Steven E. Harris notifications@github.com
wrote:

I've been working today on porting my code that relies on workqueue to
use cache.FIFO, with some awkwardness, so if workqueue could come across
I'd stick with it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnglhDqHp2HQfWKLYhRmwu_M9mbETIYks5qt_jVgaJpZM4J5tgT
.

@seh
Copy link

seh commented Sep 27, 2016

I see that kubernetes/kubernetes#33334 merged today. Is it the case that the next run of copy.sh will put the informer stuff into this repository?

@caesarxuchao
Copy link
Member

#33334 ran the copy.sh. The next run (every 12 hours) of the bot will push the change to client-go. workqueue is still missing though.

@seh
Copy link

seh commented Sep 28, 2016

Thar she blows! Commit 5974905 includes cache.NewInformer—though only in version 1.5, as hinted by @mikedanese earlier.

Should we expect it to arrive in the version 1.4 subtree soon, or is that out of scope?

@caesarxuchao
Copy link
Member

Should we expect it to arrive in the version 1.4 subtree soon, or is that out of scope?

Depending on how bad people want it. It requires cherrypicking kubernetes/kubernetes#32718 and kubernetes/kubernetes#33334, i.e., it requires some labor.

@mqliang
Copy link

mqliang commented Sep 28, 2016

@caesarxuchao files under 1.5/tools/cache/ are in package testing, instead of cache, is it intended?

see https://github.com/kubernetes/client-go/blob/master/1.5/tools/cache/controller.go#L17

@caesarxuchao
Copy link
Member

No, it's a bug. I'll take a look.

@seh
Copy link

seh commented Sep 28, 2016

@caesarxuchao, I'm not sure when it's safe for me to start using the 1.5 subtree. Is it guaranteed to work against a Kubernetes version 1.3 cluster? That hesitation is what had me using the 1.4 subtree.

@lavalamp
Copy link
Member

The 1.5 subtree is backwards compatible. However, the go interface will not
be frozen until 1.5 is released, i.e., it's mutable--tracking head--until
then.

So if you use the 1.5 client, be aware that we may make interface changes
that require you to change your code. We haven't done this yet, but we
probably will.

I'm totally open to cherrypicking client changes into the 1.4 client
branch-- now that 1.4 is released we should be able to do that without
getting the evil eye from the release czar. Maybe after Chao fixes the
package name. :)

The thing we absolutely cannot do is change the interface in the 1.4
client--no changes there that will make folks who import it change their
code. We only make changes like that over version boundaries.

On Wed, Sep 28, 2016 at 6:06 AM, Steven E. Harris notifications@github.com
wrote:

@caesarxuchao https://github.com/caesarxuchao, I'm not sure when it's
safe for me to start using the 1.5 subtree. Is it guaranteed to work
against a Kubernetes version 1.3 cluster? That hesitation is what had me
using the 1.4 subtree.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAngljd_txC5GQEN3W3lXAeJ0kOnDRjDks5qumZPgaJpZM4J5tgT
.

@seh
Copy link

seh commented Sep 28, 2016

Thank you for the explanation. I would appreciate a back-port, should one arrive soon, but in the meantime I'll try using the 1.5 client and see how it goes.

@jimmidyson
Copy link
Member

jimmidyson commented Sep 28, 2016

no changes there that will make folks who import it change their
code. We only make changes like that over version boundaries.

As you're versioning this in line with kubernetes itself, this obviously goes against semver. Not that semver is a panacea but at least it gives a feel for API stability.

@lavalamp
Copy link
Member

Indeed, that's a great point. Maybe we should version the go client
independently. I've put this on my list of things to think about.

On Wed, Sep 28, 2016 at 10:35 AM, Jimmi Dyson notifications@github.com
wrote:

no changes there that will make folks who import it change their
code. We only make changes like that over version boundaries.

As you're versioning this in line with kubernetes itself, this is
obviously goes against semver. Not that semver is a panacea but at least it
gives a feel for API stability.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnglhk5jZsGORqbnoopeI3JKj2TtYq7ks5quqV3gaJpZM4J5tgT
.

@fabxc
Copy link

fabxc commented Sep 28, 2016

As it's pulled together from the kubernetes repo, independent versioning would ultimately leek into that. Even if intentionally developing on the most recent version, having the the sanitized package layout is valuable.

Maybe it's simplest to stick with freezing together with kubernetes but calling the non-frozen version "nightly" or "head"?

@lavalamp
Copy link
Member

We talked a fair amount about this at the API Machinery SIG just now. I
think we definitely need to make it more clear what we're doing here.

Note that we haven't actually broken compatibility between 1.4 and 1.5 yet
so technically we're still following semver :)

On Wed, Sep 28, 2016 at 11:07 AM, Fabian Reinartz notifications@github.com
wrote:

As it's pulled together from the kubernetes repo, independent versioning
would ultimately leek into that. Even if intentionally developing on the
most recent version, having the the sanitized package layout is valuable.

Maybe it's simplest to stick with freezing together with kubernetes but
calling the non-frozen version "nightly" or "head"?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAngltdkhzYiuugtc1ChQYeyX1Cq8m94ks5quqzigaJpZM4J5tgT
.

@caesarxuchao
Copy link
Member

I'll keep it open until we move workqueue.

@lavalamp
Copy link
Member

I'm not quite sure why github closed this?

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Oct 6, 2016
…heus

Automatic merge from submit-queue

decouple workqueue metrics from prometheus

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
We want to include the workqueue in client-go, but do not want to having to import Prometheus. This PR decouples the workqueue from prometheus.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Partially address #33497
User requested for `workqueue` in client-go: kubernetes/client-go#4 (comment)

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
The implicit registration of Prometheus metrics for workqueue has been removed, and a plug-able interface was added. If you were using workqueue in your own binaries and want these metrics, add the following to your imports in the main package: "k8s.io/pkg/util/workqueue/prometheus".
```
@caesarxuchao
Copy link
Member

informers and workqueue are in the master branch now. Closing.

perotinus pushed a commit to kubernetes-retired/cluster-registry that referenced this issue Sep 2, 2017
…heus

Automatic merge from submit-queue

decouple workqueue metrics from prometheus

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
We want to include the workqueue in client-go, but do not want to having to import Prometheus. This PR decouples the workqueue from prometheus.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Partially address kubernetes/kubernetes#33497
User requested for `workqueue` in client-go: kubernetes/client-go#4 (comment)

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
The implicit registration of Prometheus metrics for workqueue has been removed, and a plug-able interface was added. If you were using workqueue in your own binaries and want these metrics, add the following to your imports in the main package: "k8s.io/pkg/util/workqueue/prometheus".
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.