kubernetes-sigs / karpenter

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
Apache License 2.0
577 stars 193 forks source link

Add NodeClass label to nodes for scheduling and observability #854

Open jonathan-innis opened 10 months ago

jonathan-innis commented 10 months ago

Description

What problem are you trying to solve?

There's currently an issue open in aws/karpenter-provider-aws that's requesting the addition of the karpenter.k8s.aws/ec2nodeclass as a well-known label that can be used for scheduling and assigned to nodes for observabillity: https://github.com/aws/karpenter-provider-aws/issues/5178. We think that this could be generalized across all cloud providers.

We currently don't enforce the kind or apiVersion of the nodeClassRef but as we are progressing to v1, I think that we should consider requiring users specify this. If we enforced that users had to specify this field, we could add this label for scheduling and node label propagation as <group>/<kind>: <name>

How important is this feature to you?

This improves observability for users as called out in: https://github.com/aws/karpenter-provider-aws/issues/5178

github-actions[bot] commented 9 months ago

This issue has been inactive for 14 days. StaleBot will close this stale issue after 14 more days of inactivity.

sftim commented 7 months ago

How about making it an annotation, not a label? That way, the annotation could store a JSON blob that uniquely identifies the group, kind and name of the node class.

If we want a simple string, I would use the URL path of that resource in Kubernetes' API. eg /apis/karpenter.k8s.aws/*/ec2nodeclasses/example or a string with an obvious derivation such as karpenter.k8s.aws/ec2nodeclasses/example.

Alternatively, use two labels, eg: karpenter.sh/node-class-api-path: /apis/karpenter.k8s.aws/v1beta1/ec2nodeclasses karpenter.sh/node-class-name: example

(which would still allow for compound selectors)

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

jonathan-innis commented 3 months ago

/remove-lifecycle rotten

k8s-triage-robot commented 1 week ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale