kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.52k stars 1.3k forks source link

Provide ability to set annotations on worker nodes #7409

Open shyamradhakrishnan opened 1 year ago

shyamradhakrishnan commented 1 year ago

User Story

As an operator I would like to have the ability to set annotations on worker nodes created by CAPI. This is similar to the ability to set labels which is being currently worked on.

Detailed Description

In many cases, annotations are used to set metadata on nodes. For example in OCI, compartment id can be set on nodes which will help in discovery of nodes by cloud provider, as well as lookup vnics. Other providers may also have such use cases.

Anything else you would like to add:

[Miscellaneous information that will assist in solving the issue.]

/kind feature

sbueringer commented 1 year ago

For example in OCI, compartment id can be set on nodes which will help in discovery of nodes by cloud provider, as well as lookup vnics.

I'm fine in general with the requirement.

Just a question about this specific case. I don't exactly know what a compartment is, but I wonder if it's the kind of metadata that in some clouds is provided by the cloud-provider running inside of the workload cluster.

fabriziopandini commented 1 year ago

/triage accepted /help

I think we should implement label propagation first, and then build on top of it

k8s-ci-robot commented 1 year ago

@fabriziopandini: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes-sigs/cluster-api/issues/7409): >/triage accepted >/help > >I think we should implement label propagation first, and then build on top of it Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
kfox1111 commented 1 year ago

taints is important too. should that be another issue too or wrapped up with labels or annotations?

musaprg commented 1 year ago

Label propagation has been supported by https://github.com/kubernetes-sigs/cluster-api/pull/7173. It would be a good time to step onto annotations. (AFAIK it's not implemented for now)

We may have two questions that need to have consensus:

Q1. Should we only allow annotations with predefined prefixes? Q2. Which annotation value should have precedence if the specified one on the Machine object exists on the corresponding Node object?

For labels, CAPI only allows propagating managed labels. To achieve the original motivation of this PR, I suppose we anyway need to allow arbitrary annotations on Machine objects to be propagated.

In terms of Q2, for labels, ones on Machine objects always have precedence. IMO it would make sense to follow the same policy for annotations as well.

I'm interested in working on implementation and ready to prepare a PR.

fabriziopandini commented 5 months ago

/triage backlog

k8s-ci-robot commented 5 months ago

@fabriziopandini: The label(s) triage/backlog cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/kubernetes-sigs/cluster-api/issues/7409#issuecomment-2051801866): >/triage backlog Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
fabriziopandini commented 5 months ago

/priority backlog