containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[EKS]: EKS Cluster Tagging Propagation

Open tabern opened this issue 5 years ago • 29 comments

Tell us about your request Ability to propogate EKS cluster tags to EC2 resources (instances, autoscaling groups, load balancers) used as part of the cluster. This will help with resource organization and cost allocation within your AWS account.

Feedback requested Should we expand the scope of this to include propagating K8s labels to AWS tags and giving you the ability to assign labels used for resources within certain namespaces, services, etc as AWS tags on related resources? This is one path to improving cost allocation capabilities withing AWS and K8s.

tabern avatar Jun 17 '19 04:06 tabern

Should we expand the scope of this to include propagating K8s labels to AWS tags and giving you the ability to assign labels used for resources within certain namespaces, services, etc as AWS tags on related resources?

Yes - I think this is a great idea. It would be a really ace integration and, other than just for cost allocation, it would make it easier to programatically select k8s-managed resources in custom ops scripting.

tdmalone avatar Jun 18 '19 23:06 tdmalone

First, make it work. Then make it work better. Expanded scope is great as long as it does not delay the release date.

xanderbo avatar Jul 30 '19 10:07 xanderbo

I was just deploying a ALB using ALB Ingress controller and I notice that we do have the ability to tag it by annotating the Ingress.

annotations: alb.ingress.kubernetes.io/tags: auto-delete=no,owner=gmagella,app=my-1st-flask

Looks like it does tag the ALB and the TG. But I couldn't help but notice that it didn't update tags on the ALB, when changing the Ingress details. (it does update the TG tags though).

Let me know if this is not the right venue to comment on this, and I'll take appropriate actions.

gmagella-ca avatar Dec 04 '19 16:12 gmagella-ca

Would be nice to propagate these tags to EBS volumes too.

i5okie avatar Jan 09 '20 19:01 i5okie

Did the tags used to work? I thought they did but all my nodeGroups now no longer have the tags specified in the eksctl configuration. Need to get these tags back in as they are used for Cost reporting.

cdenneen avatar Oct 05 '20 15:10 cdenneen

[edit] eksctl can propagate tags for self-managed and managed node groups. however if you use CFN or the API, tags for EKS managed node groups do not propagate. We are working on enabling tag propagation for EKS clusters from the cluster down to nodes through the EKS API.

tabern avatar Oct 05 '20 16:10 tabern

Hi @tabern is there anymore news on this please? ♥

jasongaunt avatar Nov 30 '20 11:11 jasongaunt

I'm not exactly sure which issue to put this on so I'll probably but it in a decent number of issues but not having propagating Tags to all EKS cluster resources effectively makes this entire service useless. If you can't tag your resources you can't separate out costs between different programs and therefore will never be allowed by a program manager and rightfully so. This needs to be fixed ASAP.

MichaelX99 avatar Dec 22 '20 23:12 MichaelX99

it would be great if labels on EKS resources could be used as cost-allocation tags. The few taggable EKS resources currently do minimal to help us with cost allocation. We need tagging and propagation.

ayanich avatar Jan 05 '21 13:01 ayanich

Would love to have tags propagated for EKS created security group

Andrey9kin avatar Feb 08 '21 16:02 Andrey9kin

I agree with the above statement around making it work as the priority. With the heavy dependency and enforcement around tagging, it is upsetting to see that the behavior we have come to expect with tag propagation is not present in EKS. This is causing us to have to create exceptions and workarounds to problems such as auto scaling groups not being tagged and slowing down velocity as we look to migrate from ECS to EKS.

It would be great to understand what sort of time line we are looking at for resolving this as the priority.

Outside of fixing what is missing today, enabling additional k8s label propagation to aid in further dissecting costs is secondary, I would think. For us, fixing the tag propagation actually gives all of the data we need for cost allocation in EKS.

tuxtek avatar May 05 '21 15:05 tuxtek

eksctl 0.48 will be supporting user defined tagging for EKS resources. Please see https://github.com/weaveworks/eksctl/releases/tag/0.48.0-rc.0

Tags will be propagated to managed and self-managed nodes and its resources such as instances and ebs volumes

saleem-mirza avatar May 05 '21 17:05 saleem-mirza

+1. It'll be very good to propagate user defined tags to ENIs using Launch Template

nikitacr7 avatar Sep 08 '21 07:09 nikitacr7

Any update on this? Tag propagation from eks node groups to ec2 instances is a no brainer. Some of us use CDK to define our infrastructure and now there is no way to add any custom tags to EKS managed nodes.

gkaskonas avatar Mar 31 '22 15:03 gkaskonas

For instances specifically, you can set the tags in the Launch Template instead of setting them somewhere higher and propagating them down.

As well as being the approach that AWS has already implemented and recommends for this use-case, this mechanism has the advantage that you can propagate those or other tags to associated EBS volumes for the instance, which ASG-propagated tags do not support. See Tag Auto Scaling groups and instances and Creating a launch template for an Auto Scaling group for reference.

TBBle avatar Mar 31 '22 21:03 TBBle

eksctl supports custom tag propagation to underlaying resources

saleem-mirza avatar Apr 01 '22 12:04 saleem-mirza

I don't think eksctl supports any propagation beyond what EKS already supports. It does have some features to copy tags around from place to place, mostly related to what I described in my previous comment, and for working around #608.

That doesn't cover the use cases described in this ticket, such as "Setting a tag CostCentre=Project2 on the EKS Cluster object will automatically put that tag on the NLB instance created for a LoadBalancer Service".

TBBle avatar Apr 01 '22 12:04 TBBle

@TBBle eksctl do support tag propagation since version 0.48. However, tags are only propagated to ec2 and ebs volumes.

ALB or ELB are not created when EKS cluster is created. However, you can always use annotations to push tags to load balancers. see https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/service/annotations/

Disclaimer: I am contributor for tagging support in EKS (https://github.com/weaveworks/eksctl/pull/3639)

saleem-mirza avatar Apr 01 '22 12:04 saleem-mirza

That was my point. The only tag propagation eksctl supports is the one EKS implements: from ASGs to their EC2 instances and from Launch Templates to their EC2 instances and EBS instances. That's the PR you linked to, which implements the eksctl side of that EKS feature. It doesn't do anything more for this than can be done with e.g., CDK or terraform, because it calls the same APIs.

This ticket is asking for exactly the propagation you've noted, for things that do not exist when the cluster is created, but are created later, and still need to be visible for, e.g. cost allocation. Because eksctl is not running "later", it can't support that without an EKS feature behind it. Which is what this ticket is effectively requesting.

The workaround for NLB for example is annotations on the Load Balancer, but that's not propagation, that's just repeating the same tags all through your config (and other cluster user's configs).

TBBle avatar Apr 01 '22 12:04 TBBle

I just encountered another location that tag propagation would be helpful. Granting access via Tags in AWS CloudWatch. the /aws/eks/*/clusters:* audit logs don't have any tags attached from the eks cluster.

TechIsCool avatar Apr 28 '22 23:04 TechIsCool

+1. It'd be useful especially we are working from Terraform environment.

andylim0221 avatar Jul 06 '22 10:07 andylim0221

While EKS does not support custom tag propagation which this issue covers, a noteworthy recent improvement we have made is adding a cluster name AWS cost allocation tag to every EC2 instance that joins an EKS cluster. Details in the What's New post.

mikestef9 avatar Aug 26 '22 00:08 mikestef9

What we are really expecting is to be able to work with our own tagging system already in place.

vce-xx avatar Oct 18 '22 14:10 vce-xx

[edit] eksctl can propagate tags for self-managed and managed node groups. however if you use CFN or the API, tags for EKS managed node groups do not propagate. We are working on enabling tag propagation for EKS clusters from the cluster down to nodes through the EKS API.

@tabern 2 years have passed, still working on it, or should this issue be moved to another column on the roadmap?

IMHO the "use eksctl" approach is not a valid one since if you're doing things in a repeatable way by using terraform, or the likes of it (anything that relies on the API) you won't be using eksctl. This issue messes up our billing breakdown pretty severely since it relies on tags and therefore there is a lot of unaccounted for resources in the end of the month.

mamoit avatar Oct 19 '22 09:10 mamoit

@tabern We are still waiting for this feature. Any ETA?

slam-harmonicinc avatar Mar 20 '23 22:03 slam-harmonicinc

For anyone using terraform, this comment is gold: https://github.com/aws/containers-roadmap/issues/781#issuecomment-1443961282 Tagging the autoscaling group only covers one aspect of the original request but load balancers can be handled with annotations if you're using the load balancer controller.

rabidscorpio avatar May 11 '23 15:05 rabidscorpio

We would like to see this implemented as well, specifically for the Cloud Watch Log Groups

andrewegel avatar Sep 13 '23 15:09 andrewegel

Any update on this ?

seyal84 avatar Jan 17 '24 05:01 seyal84

Still waiting for this.

DhruvBundheliya avatar Apr 05 '24 10:04 DhruvBundheliya