Add a meeting Rate this page

A

All right, uh hello and welcome to the q builder controller, runtime and controller tools meeting for thursday august 27th 2020..

A

As a reminder, this meeting is being recorded, so you know, bear that in mind and don't say anything you don't want recorded for all posterity uh so looks like we just have two items on the agenda so and they're both from alvaro so alvaro. Why don't you take it away.

B

Yes, so the first item is the deprecation of the I believe it's called new fake client function, which creates a new fake client without taking a scheme as an argument and then using the default scheme from kubernetes.

B

So today this thing is marked as deprecated and because of that, someone created a request to remove it, and I would like to keep it because, while I understand the value of having a new fake line with scheme, it's not really clear to me what value we get from enforcing that you have to pass around the scheme. I've personally never used the custom scheme and so far this works for me um yeah.

B

What do you think? So? I don't even really know where this thing is advocate, except it's not good to use globals I get that, but for the scheme. In my experience it seems to mostly work.

A

I think uh I think there's two parts to it. I think a it may have been deprecated as part of just the general like deprecation of a fake client, that just with the indication that we need to overhaul fake client a bit, and I think the second was that people ended up using crds and then being confused as to why the fake client wasn't working, not realizing that they needed to pass in a scheme.

A

And I think that may have contributed to it as well.

A

I think I think we can just hold off on that for now, and just put it under the category of fake client needs an overhaul, but we're not gonna we're not gonna like move on removing anything. For the moment, um we should probably have a have a have a comment. That's like this is not a deprecation of removal. Necessarily, this is a deprecation of the current interfaces will probably be overhauled.

B

Okay, so the notice actually explicitly says deprecated use new fake lined with scheme. So it's not part of the general file. Client is typically.

A

Oh okay, uh yeah! If that's the case, then I think it's just. It was the latter. Where we people were. I vaguely recall this. People were using the fake client a lot and not realizing that, like they needed to pass in a custom scheme.

A

I think um I think it was. I think it ended up being like just that.

B

Can we, then, maybe instead try to improve the error in case uh this? Is you being used with something that's not registered on whatever scheme ends up being used? Yeah, you need to add this to the scheme.

A

I think I think we can do that. um I think there's there's a, I think, there's a few things we can do around that area. um But if, if that's like yeah, I think I think we can keep probably keep that around okay cool.

B

As I also have the second topic, I will start with this, so today we basically have it hard coded in the manager that it if leader election, is enabled always uses a configmap for that and people want to be able to use different things most, notably the there's some new resource.

B

For this I forgot the name I think lee's, it's called um yeah and today this isn't possible, and the question is a bit how how we move forward with this, because, on the one hand, it's totally legit to want to use the least resource instead of a conflict map. On the other hand, we need to be ex very careful to not break existing users that currently use a config map.

B

So yeah one option I could imagine is that we just make this configurable but keep the current default forever as to not silently back users.

B

It's not great, because then we are forever stuck with a non-ideal default, but I can't think of a better alternative. What do you think.

A

um Yeah, I that's kind of where I am. I think the only way that we could change the default is if we had like a very long deprecation period, or we had some sort of thing where, like it, it ended up panicking if you didn't explicitly or or returning an error. Rather, if you didn't explicitly configure it or something like I, I think probably the thing to do here. How did how did core kubernetes do? The switchover is? Is this.

B

There, actually, it's possible to use a strategy where you use multiple things um as a for a transition.

B

um However, if we do that, we need an extremely long period, because sometimes people jump controller, one-time versions, so that would be an option. So you can basically say you want to use a config map and leader lease, for example, police.

A

Yeah, I think I think, probably that's the only really safe because, like I think we probably do want to change the default eventually.

A

So I think maybe just like get the ball rolling on that now uh uh print out, maybe print out a warning message or something uh I guess if we're changing the default, just put something big in the release notes, that's just like for a few releases. That's just like by the way, if you skipped versions, please use one of these intermediate versions during upgrade and just have a real long switch over period.

A

Okay and have.

B

A note yeah, oh.

A

Yeah and have a note in the code, that's like uh definitely do not remove this overlap. Unless you really really really know what you're doing- and it's been you know, six months to a year or something.

B

Yeah, okay, so basically default to config map plus lease.

B

Add a note in the source code saying we need to keep this for a very long time to be very sure that everyone who upgrades eventually ends up defaulting to the strategy, and on top of that for the people who know they can do that at the possibility to explicitly configure a strategy.

A

Yeah, I think so, um when did when did kubernetes introduce lease as a as a stable option or a stablish option? Do.

B

You remember, I think, it's pretty long ago, like 111 112 113, everyone should have it even the ones that use managed cube at this point.

A

Okay, yeah, that that was that was mainly my question. Okay, so I think I think we're pretty good to just execute on that plan. Then.

C

Okay, I have one question uh which maybe we don't want to do, but something I looked at just like temporarily a little bit ago, which is so operator. Sdk we've had this leader for life uh leader election approach. That seems like it covers different use cases, and maybe you would use lease versus leader for life for different reasons, but it seems like leader for life, has some validity.

C

um So I'm curious, I was going through control of runtime trying to see if I could um plumb a leader for life mechanism into the existing uh exposed apis for leader election. It seems like it's basically not possible, so I'm wondering if, as part of this or maybe separately, it would make sense to make controller runtime handle more generic leader election implementations.

C

Somehow.

A

Yeah I mean that would probably that would probably be useful. I I feel like, if there's a point where it's like really not possible, to implement something interesting like that in controller runtime. There's an area where, like I, I consider that, like kind of a bug or deficiency uh in in our code base.

A

Can you can you like detail the rough edges or whatever in a in a issue or something.

C

Yeah, it's been, it's been a while, so I can't remember what the problems were off the top of my head, but I'll. If I get back to it, I'll definitely do that.

D

uh Is there a way to, as I wonder joe if it was, it would be as simple as if there was a way to just turn off leader election? The way it's implemented by default, because I mean leader for life? Is a nice like drop in?

D

You know three lines of code independent or it can even as a pattern you know, could in theory be used as like an init container or something totally external for somebody who was, you know, writing their controller in a different language, or something like that and could take advantage of that. So I don't know. Is that an option? Can you right here a don't use, introduction and provide your own.

C

You can do that. I think um I think what I was running into is that right now, controller runtime has some nice books to let you say, do some things before I elect leader and do other things after I elect a leader, and so because of like that functionality I was trying to get the leader for life implementation uh into like kind of in the middle of those things. I think it's totally doable to do. You know leader of election outside control, run time, but then you're either doing it before everything or after everything.

A

Yeah, I I like you can do stuff, like you know, if you're running both web hooks and and the controller in a single binary, you could have you know. You'd have everything runs web hooks, but only the leader runs controller, for instance, or something like that.

A

um Yeah so definitely definitely file that issue, um and we can see what what like why, where the problem is and how we can address it.

A

Cool yeah.

A

All right uh does anyone have anything.

A

Else.

A

Looks like no, uh in that case, uh happy thursday. Everyone and I'll see you all in a couple weeks.

A

Thank you. Bye, see you bye.

C

Thanks ellie have a good day.
youtube image
From YouTube: Kubernetes KubeBuilder Meeting 20200827

Description

KubeBuilder Meeting for 2020/08/27. See https://sigs.k8s.io/kubebuilder for more details.