Closed tmoreadobe closed 10 months ago
Yes let me add it here what label maker is doing
After reading through the shared code, I realize that there is a third scenario:
In this case, I can see that Label Maker is retrying on conflict (which means that it respects the conflict response if the resource version is out of date); however, when it does the retry, it looks like it still overwrites the labels based on the old version of the labels from the initial GET operation here: https://github.com/tmoreadobe/label-maker/blob/master/pkg/controller/labelmaker/labelmaker_controller.go#L95. If you wanted to make sure that this was properly handled, you would basically need to make this callback function here https://github.com/tmoreadobe/label-maker/blob/master/pkg/controller/labelmaker/labelmaker_controller.go#L129 only set the specific labels that you care about rather than fully overwriting the labels with the outdated version.
Can you explain in more depth what label maker is doing and why you have a need for it for your use-case? Is there anything that we can leverage within Karpenter or elsewhere to enable this label updating if the component there is out-of support?
yeah understood @jonathan-innis . I already have made changes and this should work but the problem with this app is that it's very old and the build process is busted. Is there a possibility that we can add custom labels in the startup on all the nodes provisioned by karpenter?
The label-maker is adding node-role.kubernetes.io/node
to the worker nodes. When we list nodes, the roles can be seen with this label. We have certain monitoring usecases where we need this label. If this can be supported within karpenter, this would resolve lot of the hassle we are going through and make us adopt karpenter fairly quickly.
The label-maker is adding node-role.kubernetes.io/node to the worker nodes
Just so I understand the challenge here: Is it that you need the value of that label to be templated based on the name of the node? Is that what's restricting you from just being able to add that label directly to the NodePool?
Yes we need that label on the worker nodes but the issue is we dont use nodepools/nodegroups. If we use nodepools, we can configure those labels in the nodepools itself in EKS.
Yes we need that label on the worker nodes but the issue is we dont use nodepools/nodegroups
NodePool has a label
section, does that not work for you? https://karpenter.sh/docs/concepts/nodepools/#:~:text=to%20all%20nodes-,labels,-%3A%0A%20%20%20%20%20%20%20%20billing%2Dteam
(I'm also realizing you may not be on the latest version of Karpenter yet so NodePool == Provisioner)
Okay, are these labels applied as soon as the node joins the cluster.
And yes we are on 0.27.3 version of karpenter since we were facing this issue post 0.28 releases š
@jonathan-innis this label for node-role is restricted and is not getting applied when specified in the label section. Do you know of any other way a karpenter can accomodate this based on the node.kubernetes.io/role: worker
label. I see this issue but it is closed and valid use case for many of the users. https://github.com/aws/karpenter-provider-aws/issues/1941
For a comment about node-role.kubernetes.io/worker
, see https://github.com/kubernetes-sigs/karpenter/issues/1046#issuecomment-1973571758
Description
Observed Behavior: For the nodes which is karpenter spinning up, karpenter is not adding
karpenter.sh/capacity-type
as both machine and provisioner has this label. Expected Behavior: karpenter should add the expected label for consolidation to work. Reproduction Steps (Please include YAML): provisionerspecmachinespec
error on the node same as of machine Versions:
Chart Version: 0.31.0
Kubernetes Version (
kubectl version
): v1.26.9Please vote on this issue by adding a š reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment