Skip to content
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

[CCE] - NodePools should support labels and annotations customization on future created nodes #2844

Open
Sryther opened this issue Feb 28, 2025 · 2 comments
Labels
enhancement otc-issue Blocked by OTC issues

Comments

@Sryther
Copy link

Sryther commented Feb 28, 2025

NodePools should support labels and annotations customization on future created nodes.

Creating a node using the opentelekomcloud_cce_node_v3 resource allows to add labels and annotations on the managed node.

labels - (Optional, ForceNew, Map) Node tag, key/value pair format. Changing this parameter will create a new resource.
/docs/resources/cce_node_v3#labels

annotations - (Optional, ForceNew, Map) Node annotation, key/value pair format. Changing this parameter will create a new resource
/docs/resources/cce_node_v3#annotations

The source code shows how it's supported:

...
createOpts := nodes.CreateOpts{
  Kind:       "Node",
  ApiVersion: "v3",
  Metadata: nodes.CreateMetaData{
  	Name:        d.Get("name").(string),
  	Labels:      resourceCCENodeLabelsV2(d),
  	Annotations: resourceCCENodeAnnotationsV2(d),
  },
...

opentelekomcloud/services/cce/resource_opentelekomcloud_cce_node_v3.go#L531

But the equivalent is not present for NodePool. We can't control labels and annotations on nodes managed by the pool:

...
createOpts := nodepools.CreateOpts{
  Kind:       "NodePool",
  ApiVersion: "v3",
  Metadata: nodepools.CreateMetaData{
  	Name: d.Get("name").(string),
  },
 ...

opentelekomcloud/services/cce/resource_opentelekomcloud_cce_node_pool_v3.go#L347

I don't know if there is a technical reason to that limitation, thus I didn't find any resource about that.

If it's not possible at all, what would be a workaround to achieve it, in a simple way?

I could add labels and annotations after the nodes creation, but due to the design of a node pool, it would be difficult to do it when a automatic scale up is triggered by Kubernetes. Right?

In any way, I would really appreciate such a feature! :)

@anton-sidelnikov anton-sidelnikov added the otc-issue Blocked by OTC issues label Mar 3, 2025
@anton-sidelnikov
Copy link
Member

Hi @Sryther,
The issue is that the API does not support updating these fields. Refer to the documentation: https://docs.otc.t-systems.com/cloud-container-engine/api-ref/apis/cluster_management/updating_a_specified_node_pool.html. An internal ticket has been created some time ago: https://jira.tsi-dev.otc-service.com/browse/OTCPR-21476

@Sryther
Copy link
Author

Sryther commented Mar 5, 2025

Thanks @anton-sidelnikov!

Unfortunately I can't access the content of the internal ticket. Do you have some visibility on it? Like is it actively developed or maybe a release date?

For now, my workaround is to create n Nodes for each pool I need with labels and annotations. But I miss the auto scaling feature or min/max nodes per pool for economic reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement otc-issue Blocked by OTC issues
Projects
None yet
Development

No branches or pull requests

2 participants