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

(aws-eks) Managed Node Group propagate the tags to Auto Scaling Group #20133

Closed
2 tasks
yws-ss opened this issue Apr 29, 2022 · 7 comments
Closed
2 tasks

(aws-eks) Managed Node Group propagate the tags to Auto Scaling Group #20133

yws-ss opened this issue Apr 29, 2022 · 7 comments
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service feature-request A feature should be added or improved. p2

Comments

@yws-ss
Copy link

yws-ss commented Apr 29, 2022

Describe the feature

Currently, there have no solution can add the tags to Auto Scaling Group which managed by Managed Node group through CDK construct. The tags on Auto Scaling Group can be used in many place, such as: Cluster AutoScaler or billing organization.

Use Case

There have a scenario need this feature. Per Cluster Autoscaler document mentioned, if the node group want to scale up from 0, we need to add the resources tags on the auto scaling group to let Cluster Autoscaler discover them. Such as:

Key: k8s.io/cluster-autoscaler/node-template/resources/$RESOURCE_NAME
Value: 5
Key: k8s.io/cluster-autoscaler/node-template/label/$LABEL_KEY
Value: $LABEL_VALUE
Key: k8s.io/cluster-autoscaler/node-template/taint/$TAINT_KEY
Value: NoSchedule

Base on current "NodeGroup" construct [2], we could not apply tags from it because managed node group tags currently cannot bring to auto scaling group. Also, "NodeGroup" construct would not return any auto scaling group information which could let us use other function such as "Tags" to directly add tag to auto scaling group.

Proposed Solution

Currently, eksctl use AWS API at the backend to propagate the managed node group to auto scaling group #5002. and provide the parameter in YAML configuration.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

latest

Environment details (OS name and version, etc.)

Linux

@yws-ss yws-ss added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2022
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Apr 29, 2022
@yws-ss
Copy link
Author

yws-ss commented Apr 29, 2022

CC @pahud

@yws-ss yws-ss changed the title (aws-eks) Managed Node Group propregate the tags to Auto Scaling Group (aws-eks) Managed Node Group propagate the tags to Auto Scaling Group Apr 29, 2022
@pahud
Copy link
Contributor

pahud commented Apr 29, 2022

Thanks @yws-ss for the detailed description. I believe this is a very common scenario for managed nodegroups with the Kubernetes Cluster Autoscaler capabilities and eksctl has already built in the tags propagation via the SDK call under the hood.

It seems to me that we might make it a default or optional behavior for the tags propagation through a CDK custom resource for the hack.

wdyt @otaviomacedo ?

If you agree maybe I can invite someone from the community for the PR.

cc @peterwoodworth and @ryparker

@Naumel Naumel added p2 and removed needs-triage This issue or PR still needs to be triaged. labels May 17, 2022
@otaviomacedo
Copy link
Contributor

@pahud Yes, it seems the only way to solve this is with a custom resource.

@otaviomacedo otaviomacedo removed their assignment Jun 27, 2022
@jpmcb
Copy link

jpmcb commented May 15, 2023

Is there any update on this? I'm running into something similar with the GO cdk:

        myCluster.AddNodegroupCapacity(jsii.String("my-nodegroup"), &eks.NodegroupOptions{
		InstanceTypes: &[]ec2.InstanceType{
			ec2.NewInstanceType(jsii.String("m5.xlarge")),
		},
		MinSize:  jsii.Number(5),
		AmiType:  eks.NodegroupAmiType_BOTTLEROCKET_X86_64,
		NodeRole: nodeRole,
	})

        // Further down with the entire stack
        awscdk.Tags_Of(stack).Add(jsii.String("Name"), jsii.String("my-custom-nodes"), &awscdk.TagProps{
                ApplyToLaunchedInstances: jsii.Bool(true),
        })

This tag is not propagated to the instances that get launched through the node-groups auto-scaling group.

@pahud
Copy link
Contributor

pahud commented Jun 2, 2023

This is still a feature request of EKS

aws/containers-roadmap#1657
aws/containers-roadmap#1541

@pahud
Copy link
Contributor

pahud commented Jun 3, 2024

closing in favor of #29280 (comment)

@pahud pahud closed this as completed Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

5 participants