Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: eparis The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@derekwaynecarr mwahahahaha |
|
@eparis: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
😆 |
|
What other components would write MachineConfig objects using this? I remember a while ago we had an issue where cluster/machine API was entirely overwriting taints but that was just a bug, right? |
|
ok, weird, maybe it does work? unexpected on the first try.... |
| return err | ||
| } | ||
|
|
||
| newNode := oldNode.DeepCopy() |
There was a problem hiding this comment.
you need a fresh copy of the node object here at every iteration if there's a conflict?
There was a problem hiding this comment.
Happened to notice the mcd has updateNodeRetry().
|
My/The problem is that adding and removing labels and taints is an imperative action on top of what is supposed to be a declarative system. This means that it's not possible for us to create a working 3-node cluster declaratively (since the masters are created with the master taint). Yes imperative code can run and then remove the taint, but that is not kube like. This would allow us to create an MC which explicitly removed the master taint. Such a thing is a requirement for 3-node clusters and for the RHHI/foundation initiative. |
well, i'm not plumbing the MC into the RenderConfig yet, so I guess it doesn't work yet. What would be the team's thought on putting the 'role' into the renderConfig? It would allow me to cut down the number of kubelet templates at least... |
I can't see anything against it to drive this (as it requires differentiating between roles anyway) - I'll keep reading and understanding this though |
It might make the code a little simpler. Not sure. I'll probably keep slowly poking. Thank you! |
OK so you're trying to fix #763 - a
(Also a requirement for Code Ready Containers) |
|
With respect to implementation, did you have any opinions on my other suggestions in that issue? |
|
I like to show up with PoC code to show something is possible. I don't care if this code is completely rejected. Probably my years in the kernel where it is normal. I understand and can have a design discussion a heck of a lot better having coded (most of) it. I think it's more than 763, but agree, that is the current thing forcing me to look at the space. The declarative management of labels and taints, instead of imperative, is a meaningful win to me. |
| --container-runtime=remote \ | ||
| --container-runtime-endpoint=/var/run/crio/crio.sock \ | ||
| --node-labels=node-role.kubernetes.io/master,node.openshift.io/os_id=${ID} \ | ||
| --node-labels={{masterLabels .}} \ |
There was a problem hiding this comment.
One thing I discovered is that --node-labels docs clearly says:
Labels to add when registering the node in the cluster
So changing it post-registration won't do anything. Hence I think we shouldn't template this; the systemd unit should register with the default labels/taints (as the code is today). And then the MCO comes by later and updates them dynamically.
We also want to avoid using MachineConfig for this because e.g. changing a MC today involves rebooting and we clearly don't need to reboot for removing the master taint.
There was a problem hiding this comment.
This part was intended to make the NEXT node join correctly. Instead of getting 1 set of labels and then later having that set get updated. For existing nodes I update those:
https://github.com/openshift/machine-config-operator/pull/845/files#diff-a44cd14a0381ca49bcbaaf967b3cc9b0R556
The fact that an MC change requires a reboot is kinda stinky....
There was a problem hiding this comment.
This part was intended to make the NEXT node join correctly.
Doesn't hurt to have a master start !schedulable briefly. For workers...we may indeed need support for adding user-specified custom labels on bringup for special hardware and the like, but I think most cases of that end up adding taints instead post-registration.
There was a problem hiding this comment.
Adding labels and removing taints post-join is reasonable. But adding a taint post join isn't really the best in my mind, since an inappropriate workload may have landed before the taint was added. So I sort of feel like the right taints should be added by the kubelet at join.
We could add every node with some megataint in the template. But then removing that taint would be required for every new pool. Which of course we can get right for our defaults, but is a likely bad stumbling block for users who aren't super savy.
I guess that means I feel like I can drop this part for labels, but the complete story seems weak if I drop it for taints....
There was a problem hiding this comment.
But adding a taint post join isn't really the best in my mind, since an inappropriate workload may have landed before the taint was added.
True.
|
How about having the taints be part of |
|
I haven't fully traced through your logic here but I suspect we have "ownership" problems. This is quite analogous to kernel arguments which are an array of key=value strings too. Today the way the MCD handles this is to diff two MCs but I don't see your code doing a similar diff. If we don't diff, then we can't easily know which args we wrote versus which args were written by a user or other code. |
I tried to create an API that didn't suffer from these difficulties. The API I'm proposing has an explicit 'these labels must exist' and 'these labels must not exist' concept. The hope being that I don't need to track previous state or user changes, and i'm only going to make sure the specified labels are either present or not present. |
Mmm. OK, I think that's workable. So where that leaves us then is whether or not this should go through Having the node controller do this is by far the easiest code wise but it makes the architecture uglier - this label stuff is a "sidecar" to what it is currently doing and isn't correctly tracked via status e.g. |
We can probably do something here, yes (and that would avoid a reboot). But I admittedly really like the MC merging concept. |
|
I did an alternative (subset) in #849 (I don't want to discourage a new contributor but this is also a new nontrivial API surface) Let me know what you think about it! If we move forward with this PR, one thing to consider is doing what I do in 849 and have the MCD own updating the node. That makes everything much clearer I think; the |
If a user or code adds the `worker` role to the masters, automatically remove our `NoSchedule` taint. Alternative to openshift#845 Closes: openshift#763
|
I'm going to close this generic label/taint management PR. After discussion with the other openshift architects they thought this work was too far ahead of itself and we should wait for more users to want generic taint/label reconciler before we do more here. Instead they want to do something more directed (sorta like in #849) but they thought that the scheduler operator should be what implements that. Not the MC* codebase. |
This provides a declarative API to drive the setting and removing of labels and taints. It does not work.