-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
tag node root volumes properly #1030
Comments
As it took me a bit of time to figure out how to do that with eksctl, here is an example First create an IAM policy to allow tag creation Cust-Ec2Tags-Policy
Then in your config file update your nodeGroups section with :
Note that in this example it will propagate only tags with a specific prefix "prefix_" Hope that may help someone |
Thank you @JeremJR , this helped a lot! 👍 |
Doing it from a script within the new instance won't be good enough for billing tags, as there is a short period where the volume exists, but is not tagged. According to this https://forums.aws.amazon.com/thread.jspa?threadID=122354&start=25&tstart=0, There is a way to tag the volumes within an Auto Scaling Group via Launch Templates. Apparently eksctl already uses launch templates, maybe all we need is a way to populate them with the tags. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Just to confirm: It's the year 2021 and we have to manually add tags to EBS volumes mounted on to EC2 instances launched from EKS manually? Like using that bash script above. NOT COMPLAINING. just verifying :) |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
oh I ain't letting this die just out of spite now |
The fact that this feature is still open and not prioritized is fascinating. |
Will anyone take a look at this? We have some EBS volume enforce tagging policy. |
Just want to piggyback on this; how is it in 2021 AWS doesn't allow a OU level SCP for tagging actually work because of major services that need to negate it? EBS volumes is one, and Fargate is another as from console it creates a CloudFormation stack that we require tags on , and it doesn't tag it. Come on AWS, stop creating 5000 new services per week and work on the EXISTING ONES. thanks in advance! |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
Can this be re-opened? |
Apologies, the reason this wasn't prioritised is that, apparently, there was a workaround, however bad, and there were other things with higher priority awaiting fixes and features all around. It's difficult to balance these things properly. Eventually, we'll get to things though, it just takes time. Other than that, we always accept contributions. :) It's possible that this can be fixed via the launch template but it still requires time and effort and testing and verifying that the proposed solution actually works, even after the volume was rotated out. That said, we'll take a look at this and see if the launch template is a viable solution or not. |
Actually, we already tag volumes with a specific tag through launch templates: }, gfnec2.LaunchTemplate_TagSpecification{
ResourceType: gfnt.NewString("volume"),
Tags: cfnTags, where cfnTags := []cloudformation.Tag{
{
Key: gfnt.NewString("Name"),
Value: gfnt.NewString(generateNodeName(ng, meta)),
},
} I'm guessing you would like to insert custom tags in here? |
Actually, actually reading more into this. All tags, set through for k, v := range ng.Tags {
cfnTags = append(cfnTags, cloudformation.Tag{
Key: gfnt.NewString(k),
Value: gfnt.NewString(v),
})
} Which is then applied as the above. // Applied to the Autoscaling Group and to the EC2 instances (unmanaged),
// Applied to the EKS Nodegroup resource and to the EC2 instances (managed)
// +optional
Tags map[string]string `json:"tags,omitempty"` Configuration: managedNodeGroups:
- name: managed-ng-1
minSize: 2
desiredCapacity: 2
maxSize: 4
labels:
role: worker
tags:
whatever: billing The launchTemplateTagSpecs = append(launchTemplateTagSpecs,
gfnec2.LaunchTemplate_TagSpecification{
ResourceType: gfnt.NewString("instance"),
Tags: cfnTags,
}, gfnec2.LaunchTemplate_TagSpecification{
ResourceType: gfnt.NewString("volume"),
Tags: cfnTags,
}, gfnec2.LaunchTemplate_TagSpecification{
ResourceType: gfnt.NewString("network-interface"),
Tags: cfnTags,
}) The instance, the volume and the network-interface. Please verify if this is satisfactory. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
@Skarlso IDK about the original author of this issue, but for me, the tags are propagated to managed nodes and their volume, but not to the network interfaces. |
@MartinEmrich Yep, tried it. I can see that it doesn't propagate. We'll take a look. |
I can confirm that we are giving it the right value: {
"ResourceType": "network-interface",
"Tags": [
{
"Key": "Name",
"Value": "test-tags-cluster-2-managed-ng-1-Node"
},
{
"Key": "whatever",
"Value": "billing"
},
{
"Key": "alpha.eksctl.io/nodegroup-name",
"Value": "managed-ng-1"
},
{
"Key": "alpha.eksctl.io/nodegroup-type",
"Value": "managed"
}
]
} This might be an AWS issue. But I'll investigate further. |
Oh freck.
Well.... :/ |
So this gets into the area now about tagging things after creation and out of the scope of the cloudformation stack which is that... Everything we do after creation will have the effect that it's temporary. Thus, if an instance is rotated out, that's it. The tags are lost. And we can't do anything about that I'm afraid until there is AWS support for it through the LaunchTemplate. |
I raised this issue internally, let's see if there is any future regarding tagging ENIs at least. |
I came across this issue because I'm trying to solve the challenge of parsing the Cost & Usage Report and figuring out which volume went with which EC2 instance.
Unfortunately that forum link doesn't work any more so I don't know what it said. Looking at other blog posts and the like, I can see that tags and their corresponding values can be set in the launch template. But because they are fixed values, I don't see any way of setting a dynamic value like the EC2 instance ID. Is there a solution to this? |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
see https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-instance-tag-root-volume/ for a potential work around to this
The text was updated successfully, but these errors were encountered: