-
Notifications
You must be signed in to change notification settings - Fork 999
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
Support for "node-role" labelling #1941
Comments
hi @centr0nix , Thank you very much for your feedback. We do have some concerns about allowing To make matters more complicated, labels provided in the Karpenter provisioner will be injected to kubelet. But We would love to learn a bit more about your use cases so that we can come up with a better way to enable this. Would you mind sharing more details, especially:
|
Those labels must be managed through the kubernetes installer. That's why they are not allowed to be set through the kubelet flags. So karpenter is the wrong place for this. Karpenter only needs to know about these labels to do scheduling simulation correctly |
FYI we set a node-type label and then have an external helper pod set the label once the node joins the cluster, not pretty but works 🤷 |
I think this is still a valid use case. Of course it would be possible to use custom labels to achieve the same result, however, node-role.kubernetes.io/ is the de-facto standard to assign a role to nodes. The key node-role.kubernetes.io/control-plane is a well-known label and taint (originally kubeadm, but also used by others) for control plane nodes. The part of node-role.kubernetes.io/ is e.g. also shown in the node's role column in k9s. Here it is emphasized that the label is set after creating the node, which would indeed suggest that this might indeed be out of scope for Karpenter. I believe that a node's role is a valid criteria for node affinity, and for that to work, Karpenter must be aware of the label on provisioner-level, correct @olemarkus? Basically, the current situation forces users who want to label (and potentially taint) nodes by their role to either:
Thoughts? |
Karpenter must know that the node will receive such node labels, but cannot directly set them. I haven't tracked karpenter development and behavior in a while, but at some point when you specified kubernetes.io labels on the provisioner, it made karpenter aware of them for scheduling simulation purposes, but Karpenter didn't try to apply them to nodes. |
@bwagner5 @felix-zhe-huang, what do you think? Isn't it a valid use case to have node roles assigned by Karpenter directly? Is there some workaround? (One that still maintains being able to use those labels for assigning the proper provisioner.) |
Just poking in around here, has anyone found a workaround for this one. Any app they use. I have been trying to look for a potential solution but some do have conflict with karpenter and some are daemonsets which is not what we want. Any thoughts please? |
Since I have been doing Kubernetes the Hard Way for my entire time using K8s and have only recently been introduced to Karpenter, I've found the lack of this support truly puzzling. Sure, in Kubernetes the Hard Way, we add the labels afterward, but we do it in a |
Not quite. The docs might be wrong on this, but at the time of writing, the docs encourage you to label your control plane nodes as control plane (and nothing else). If you use Karpenter to manage your control plane nodes, uh, I don't think this is going to be fun - but you can get them labelled some way. Seriously, though, the docs might be wrong. I'm an approver for the Kubernetes docs, and there's mixed views about what was intended here within the project. I don't think the docs at the time of writing capture the coders' intent when they added various bits of support to core Kubernetes. What should the docs say? I don't have a lot of capacity to look into this. However, if someone has more time than I do, feel free to write up the story in terms of “the coders intended this, here's what we should document“ - and file that against k/website. Projects like Karpenter may rely on the K8s docs to work out what behavior is appropriate, and we can't really blame them. |
Fair point, it says nothing of non-control plane nodes, which makes sensesince the annotation key documented is specifically If surmising intent is the problem, then I suppose we can use the following clues:
From where I stand, the intent seems overwhelmingly in favor of allowing users to define meaingful roles and to use those in determining what kind of nodes are what, but, like you said, there are dissidents (i.e., I guess I can see a future where sig-node says "stop letting people set this" to sig-apimachinery and then whatever SIG is in charge of |
/reopen |
Maybe we should focus on kubernetes-sigs/karpenter#1046 instead, though? |
Tell us about your request
Add support for Node Role labelling
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
We would like to be able to add node role labels as required. The following PR https://github.com/aws/karpenter/pull/1882 adds node.kubernetes.io to the label domain exception list but not node-role.kubernetes.io from what I see in the current Karpenter version.
Are you currently working around this issue?
We aren't.
Additional context
Attachments
Community Note
The text was updated successfully, but these errors were encountered: