kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.93k stars 1.46k forks source link

[v2] Question: Additional Tags on Target Groups #1611

Closed alexandrud closed 3 years ago

alexandrud commented 3 years ago

Hi,

In v1 there were a couple of tags set on target groups "kubernetes.io/service-port" and "kubernetes.io/service-name". This is no longer set in v2. For us it was useful because we have scripts that look at it and try to connect to the services in kubernetes to read swagger. Based on that info we configure WAFv2 rules.

Is there a way to re-add that tag on the target groups?

Thank you!

kishorj commented 3 years ago

These are the new tags that we currently have

ingress.k8s.aws/stack  <namespace/ingess-name>
ingress.k8s.aws/resource  <namespace/service_name:service_port>
elbv2.k8s.aws/cluster <cluster_name>

In addition you can also specify additional tags via the annotation on the ingress or service resources alb.ingress.kubernetes.io/tags

taoxinyi commented 3 years ago

@kishorj I tried to add my tags in alb.ingress.kubernetes.io/tags in my service file for nlb-ip but the target group still only has the 3 tags you mentioned.

kishorj commented 3 years ago

The alb.ingress.kubernetes.io/* annotations applies for ALB only not NLB.

For NLB, this annotation service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags currently apples the tags to the load balancer resource only. I will put together a fix to apply this annotation to the target group resources as well.

taoxinyi commented 3 years ago

@kishorj Thank you very much.

kishorj commented 3 years ago

/kind feature